-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
buffer: use size_t instead of uint32_t to avoid segmentation fault #48033
Conversation
1c62637
to
ed1b2fd
Compare
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
73805bb
Compare
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? |
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.
Any chance it get merged? |
@nodejs/cpp-reviewers |
This comment was marked as outdated.
This comment was marked as outdated.
e7ba2bf
to
d80d6ca
Compare
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.