Commit 9239033
Fix buffer capacity check in varint encode to account for byteOffset (#127)
The capacity check was comparing against the buffer's total byteLength
without accounting for byteOffset. For Uint8Array views over a larger
buffer, this could incorrectly allow writes that exceed the available space.
Use dst.byteOffset + dst.byteLength + size > dst.buffer.byteLength to
properly check the actual end position of the appended data.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent 62fd026 commit 9239033
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments