Skip to content

Conversation

@nathanosdev
Copy link
Contributor

It's possible for a consumer to pass in a Uin8Array that is pointing at some offset of the underlying ArrayBuffer. This is fine for most of the code in this library, except when we create our own DataView on the underlying ArrayBuffer. Previously we were creating that DataView at the 0 index of the underlying ArrayBuffer, now we create it at Uint8Array.offset instead to ensure we do not read the wrong indexes.

@nathanosdev nathanosdev self-assigned this Jun 17, 2025
@nathanosdev nathanosdev marked this pull request as ready for review June 17, 2025 11:54
@nathanosdev nathanosdev requested a review from a team as a code owner June 17, 2025 11:54
Copy link
Member

@ilbertt ilbertt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix!

@nathanosdev nathanosdev added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 6a67dac Jun 17, 2025
10 checks passed
@nathanosdev nathanosdev deleted the nathan/handle-offset-views-correctly branch June 17, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants