| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| const base64 = 'aGVsbG8='; // "hello" | ||
| const buf = Buffer.from(base64, 'base64'); | ||
| buf.buffer.transfer(); | ||
| assert.strictEqual(buf.buffer.byteLength, 0); |
There was a problem hiding this comment.
The buffer should not be transferrable at all... This still transfers the underlying buffer.
Sorry, something went wrong.
|
This just masks the issue.
this could have corrupted other buffers allocated prior to first, not just the ones allocated after that > x = Buffer.from('hello')
<Buffer 68 65 6c 6c 6f>
> y = Buffer.from('world')
<Buffer 77 6f 72 6c 64>
> y.buffer.transfer()
> x
<Buffer >
> Which could also include buffers allocated by Node.js internally |
Sorry, something went wrong.
|
Thanks for the PR! Ultimately, I think #61372 is the correct approach here. As Nikita mentioned, this doesn't really solve the underlying issue. |
Sorry, something went wrong.
|
Thanks guys, that makes sense. Given the broader semantics (detaching a shared backing store invalidates all views), my PR isn’t the right, long-term fix. I’ll leave it to #61372 and maintainer direction from here. Appreciate the discussion and pointers! Feel free to close this PR whenever convenient. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #61362
Summary
Repro
Changes
Tests