-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Inaccurate boundary validation in Buffer.prototype.writeUIntBE/LE(value,offset,byteLength) #3497
Labels
buffer
Issues and PRs related to the buffer subsystem.
Comments
cc @trevnorris |
yup. you're correct. |
trevnorris
added a commit
to trevnorris/node
that referenced
this issue
Oct 26, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The expression
new Buffer(1).writeUIntBE(0x100,0,1)
should throw an out-of-bounds error, but it does not.
In the source code, value validation is coded as follows:
checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0);
Here, max value should be Math.pow(2, 8 * byteLength) - 1 ?
The text was updated successfully, but these errors were encountered: