Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/custom metadata header alloc #231

Merged
merged 3 commits into from
Jun 18, 2022
Merged

Conversation

viglucci
Copy link
Member

Addresses #230

Motivation:

Usage of Buffer.allocUnsafe had the potential for leaking previously allocated memory in custom metadata headers.

Modifications:

Fill buffer allocated for custom metadata header prior to writing.

Result:

Buffer allocated for custom metadata header is prevented from containing values from previously allocated memory.

@viglucci viglucci requested a review from OlegDokuka June 11, 2022 16:50
@viglucci viglucci added the 1.0 Pullrequests & issues related to the Typescript rewrite and 1.0 release label Jun 11, 2022
@viglucci viglucci changed the title Fix/custom metadata alloc fix/custom metadata alloc Jun 11, 2022
@viglucci viglucci changed the title fix/custom metadata alloc fix/custom metadata header alloc Jun 11, 2022
viglucci added 3 commits June 13, 2022 09:20
- encodeAndAddCustomMetadata
- encodeCustomMetadataHeader

Signed-off-by: Kevin Viglucci <[email protected]>
@viglucci viglucci force-pushed the fix/custom-metadata-alloc branch from 1763bfe to 01e3e2c Compare June 13, 2022 14:21
@viglucci viglucci requested a review from SerCeMan June 13, 2022 14:21
@viglucci viglucci merged commit bcd7336 into 1.0.x-alpha Jun 18, 2022
@viglucci viglucci deleted the fix/custom-metadata-alloc branch June 18, 2022 00:38
viglucci added a commit that referenced this pull request Sep 4, 2022
* fix: clear buffer when allocating for custom metadata header

* test: add composite metadata tests

- encodeAndAddCustomMetadata
- encodeCustomMetadataHeader

Signed-off-by: Kevin Viglucci <[email protected]>
viglucci added a commit that referenced this pull request Apr 27, 2023
* fix: clear buffer when allocating for custom metadata header

* test: add composite metadata tests

- encodeAndAddCustomMetadata
- encodeCustomMetadataHeader

Signed-off-by: Kevin Viglucci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Pullrequests & issues related to the Typescript rewrite and 1.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant