Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
buffer: use size_t instead of uint32_t to avoid segmentation fault#48033
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
1c62637 to ed1b2fdCompare
bnoordhuis left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's spelled uint32_t but LGTM apart from that. :-)
I spotted another bug while looking at the surrounding code: that CHECK(dlen >= slen * 2) a few lines up doesn't guard against overflow. Maybe good for a follow-up PR.
ed1b2fd to 73805bbCompareXstoudi commented May 16, 2023
Commit message amended. I could fix that bug directly if needed but I'm not sure to understand in which case would it let an overflow happen? |
bnoordhuis commented May 17, 2023
Imagine size_t is 32 bits and As a bug it's mostly hypothetical but it's not entirely in the realm of the impossible. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Xstoudi commented Jul 22, 2023
Any chance it get merged? |
targos commented Jul 24, 2023
@nodejs/cpp-reviewers |
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Dec 23, 2023
nodejs-github-bot commented May 10, 2024
e7ba2bf to d80d6caComparenodejs-github-bot commented May 11, 2024
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented May 11, 2024
aduh95 commented May 11, 2024
Landed in 05a941f |
Fixes: #46836 PR-URL: #48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: #46836 PR-URL: #48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: #46836 PR-URL: #48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: #46836 PR-URL: #48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: nodejs#46836 PR-URL: nodejs#48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: nodejs#46836 PR-URL: nodejs#48033 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Fixes: #46836
If tests are needed for this, I'll need some guidance about how to do it as I don't know how to test if something produce a segfault or not.