-
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
test: add fuzzer for native/js string conversion #51120
Conversation
Review requested:
|
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.
This is not tearing down the platform etc. properly. One possibility is copying what v8's fuzzer does and run the teardown in the destructor of a global variable:
std::vector<std::string> exec_argv; | ||
std::vector<std::string> errors; | ||
|
||
node::InitializeNodeWithArgs(&node_argv, &exec_argv, &errors); |
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.
Can this just use node::InitializeOncePerProcess()
instead? Then there's no need to repeat the initialization routines below (and potentially missing some steps whenever there are internal updates), unless there's a reason that those have to be customized (from what I can tell, that's not necessary?)
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: nodejs#51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
919306c
to
c8805b8
Compare
Landed in c8805b8 |
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: #51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: #51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: #51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: #51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: nodejs#51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Signed-off-by: Adam Korczynski <adam@adalogics.com> PR-URL: nodejs#51120 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Adds a fuzzer for the following APIs:
napi_create_string_utf8
napi_get_value_string_utf8
napi_create_string_latin1
napi_get_value_string_latin1
The PR also adds the fuzzer to Node's OSS-Fuzz build, so that OSS-Fuzz will run this fuzzer continuously.