-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
trevnorris
added a commit
that referenced
this issue
Oct 26, 2015
Fixes: #3497 PR-URL: #3500 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this issue
Oct 28, 2015
Fixes: #3497 PR-URL: #3500 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this issue
Oct 29, 2015
Fixes: #3497 PR-URL: #3500 Reviewed-By: Ben Noordhuis <[email protected]>
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: