Skip to content
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

node-api: address coverity warning #45563

Closed
wants to merge 1 commit into from
Closed

Conversation

mhdawson
Copy link
Member

  • address coverity unitialized variable warning

Signed-off-by: Michael Dawson [email protected]

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/node-api

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. node-api Issues and PRs related to the Node-API. labels Nov 21, 2022
@mhdawson
Copy link
Member Author

mhdawson commented Nov 21, 2022

This is the report. I think technically it may be a false positive, but initializing the variable seems ok as well, so PR does that versus marking as false positive.

/ Create a new napi_env for this specific module.
634  napi_env env = v8impl::NewEnv(context, module_filename);
635
   	3. var_decl: Declaring variable _exports without initializer.
636  napi_value _exports;
637  env->CallIntoModule([&](napi_env env) {
638    _exports = init(env, v8impl::JsValueFromV8LocalValue(exports));
639  });
640
641  // If register function returned a non-null exports object different from
642  // the exports object we passed it, set that as the "exports" property of
643  // the module.
   	
CID 276441 (#1 of 1): Uninitialized pointer read (UNINIT)
4. uninit_use: Using uninitialized value _exports.
644  if (_exports != nullptr &&
645      _exports != v8impl::JsValueFromV8LocalValue(exports)) {
646    napi_value _module = v8impl::JsValueFromV8LocalValue(module);
647    napi_set_named_property(env, _module, "exports", _exports);
648  }

- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>
@daeyeon daeyeon added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 22, 2022
@Trott Trott changed the title doc: address coverity warning node-api: address coverity warning Nov 22, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 22, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

mhdawson added a commit that referenced this pull request Nov 24, 2022
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@mhdawson
Copy link
Member Author

Landed in 0bbef56

@mhdawson mhdawson closed this Nov 24, 2022
ruyadorno pushed a commit that referenced this pull request Nov 24, 2022
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@ruyadorno ruyadorno mentioned this pull request Nov 24, 2022
ErickWendel pushed a commit to ErickWendel/node that referenced this pull request Nov 30, 2022
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: nodejs#45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 4, 2023
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 5, 2023
- address coverity unitialized variable warning

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #45563
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants