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 report #52584

Merged
merged 1 commit into from
Apr 26, 2024
Merged

Conversation

mhdawson
Copy link
Member

Address missing initialization reported by coverity

Address missing initialization reported by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
@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 Apr 18, 2024
@mhdawson
Copy link
Member Author

mhdawson commented Apr 18, 2024

Report from coverity

class ExternalWrapper {
 835 private:
      	2. uninit_member: Non-static class member type_tag_.lower is not initialized in this constructor nor in any functions that it calls.
      	
CID 361482: (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member type_tag_.upper is not initialized in this constructor nor in any functions that it calls.
 836  explicit ExternalWrapper(void* data) : data_(data) {}
 837
 838  static void WeakCallback(const v8::WeakCallbackInfo<ExternalWrapper>& data) {
 839    ExternalWrapper* wrapper = data.GetParameter();
 840    delete wrapper;
 841  }

Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vmoroz
Copy link
Member

vmoroz commented Apr 19, 2024

It is a good fix. Though in this code we must not be affected by the not-initialized variable because it is guarded by the Boolean flag has_tag_.

@mhdawson mhdawson added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2024
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 26, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 26, 2024
@nodejs-github-bot nodejs-github-bot merged commit e4c1d02 into nodejs:main Apr 26, 2024
68 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in e4c1d02

aduh95 pushed a commit that referenced this pull request Apr 29, 2024
Address missing initialization reported by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: #52584
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
Address missing initialization reported by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: #52584
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
Address missing initialization reported by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: #52584
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
lukins-cz pushed a commit to lukins-cz/OS-Aplet-node that referenced this pull request Jun 1, 2024
Address missing initialization reported by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: nodejs#52584
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

6 participants