-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Change between Node 6.3.1 and 6.4 regarding writing strings of length 0 to a Buffer #8127
Comments
This seems like a real bug introduced by 46f40cf, even if this is an edge case. On a first look, it seems like changing |
Ugh. Yep, confirmed. Need to add a regression test that covers this also. |
Do not throw if the offset passed to `buf.write()` points to the end of the buffer. Fixes: nodejs#8127
Ran into the same issue with node-mysql2, glad it has been identified already. |
The fix should land in the next day or two and will go out in the next patch release. Shouldn't take too long. In the meantime, you can apply the patch in #8154 to work around it. |
In Node.js v6.4.0, writing an empty string out of the buffer bounds throws an exception. This will be fixed in Node.js v6.4.1 but for now we’re going to have to stick to v6.3.1, which doesn’t have this issue. nodejs/node#8127
Got hit by this as well. Hopefully v6.4.1 can be released soon! |
@mathiasbynens Looks like it's fixed only on master, not backported to |
I've been working on getting the commits cherry-picked over to v6.x. Hopefully, will be able to get a release proposal up soon |
In Node.js v6.4.0, writing an empty string out of the buffer bounds throws an exception. This will be fixed in Node.js v6.4.1 but for now we’re going to have to stick to v6.3.1, which doesn’t have this issue. nodejs/node#8127
Node.js 6.4.0 was shipped with a bug in it's Buffer implementation that causes the tedious test cases to fail. See #431, nodejs/node#8127 and nodejs/node#8154.
In Node.js v6.4.0, writing an empty string out of the buffer bounds throws an exception. This will be fixed in Node.js v6.5.0 but for now we’re going to have to stick to v6.3.1, which doesn’t have this issue. nodejs/node#8127 nodejs/node#8253
Node.js 6.4.0 was shipped with a bug in it's Buffer implementation that causes the tedious test cases to fail. See tediousjs#431, nodejs/node#8127 and nodejs/node#8154.
In Node 6.3.1, you could do this:
That is, writing empty strings out of the buffer bounds would not cause a crash. However, with 6.4, that code above causes a crash with this error message:
This change causes my library to break. I'm wondering if this was an intentional change. If so, just let me know, and I'll patch my library to check for empty strings before writing.
The text was updated successfully, but these errors were encountered: