KEMBAR78
node-api: address coverity report by mhdawson · Pull Request #52584 · nodejs/node · GitHub
Skip to content

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
@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>
ebouye pushed a commit to ebouye/node that referenced this pull request Jun 20, 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>
bmeck pushed a commit to bmeck/node that referenced this pull request Jun 22, 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.

6 participants