-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: check for empty maybe local #32339
Conversation
src/udp_wrap.cc
Outdated
MaybeLocal<Value> maybe_chunk = chunks->Get(env->context(), i); | ||
if (maybe_chunk.IsEmpty()) return; | ||
Local<Value> chunk = maybe_chunk.ToLocalChecked(); |
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.
MaybeLocal<Value> maybe_chunk = chunks->Get(env->context(), i); | |
if (maybe_chunk.IsEmpty()) return; | |
Local<Value> chunk = maybe_chunk.ToLocalChecked(); | |
Local<Value> chunk; | |
if (!chunks->Get(env->context(), i).ToLocal(&chunk)) | |
return; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Not really sure about the value added by a test on this really really edge case.
Using ToLocalChecked on MaybeLocal without verifying it's empty can lead to unattempted crash.
Using ToLocalChecked on MaybeLocal without verifying it's empty can lead to unattempted crash. PR-URL: #32339 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 191fb3c, thanks for the PR! 🎉 |
Using ToLocalChecked on MaybeLocal without verifying it's empty can lead to unattempted crash. PR-URL: #32339 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Using ToLocalChecked on MaybeLocal without verifying it's empty can lead to unattempted crash. PR-URL: #32339 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Using ToLocalChecked on MaybeLocal without verify it's empty can lead to unattempted crash.
Before the change: this code leads Node.js to crash with C++ fatal error.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes