src: don't point to out of scope variable by cjihrig · Pull Request #27070 · nodejs/node (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

cjihrig

Coverity reported this. The addr pointer is passed to req_wrap->Dispatch(). By the time this happens, the value that addr points to, addr_storage, is out of scope. This commit remedies that.

cc: @santigimeno

Checklist

@cjihrig

Coverity reported this. The addr pointer is passed to req_wrap->Dispatch(). By the time this happens, the value that addr points to, addr_storage, is out of scope. This commit remedies that.

@nodejs-github-bot

@nodejs-github-bot nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

dgram

Issues and PRs related to the dgram subsystem / UDP.

labels

Apr 3, 2019

addaleax

santigimeno

Choose a reason for hiding this comment

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

Good catch. Thanks!

richardlau

devsnek

lpinca

ZYSzys

@ZYSzys ZYSzys added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Apr 4, 2019

@nodejs-github-bot

JungMinu

@ZYSzys

ZYSzys pushed a commit that referenced this pull request

Apr 7, 2019

@cjihrig @ZYSzys

Coverity reported this. The addr pointer is passed to req_wrap->Dispatch(). By the time this happens, the value that addr points to, addr_storage, is out of scope. This commit remedies that.

PR-URL: #27070 Reviewed-By: Anna Henningsen anna@addaleax.net Reviewed-By: Santiago Gimeno santiago.gimeno@gmail.com Reviewed-By: Richard Lau riclau@uk.ibm.com Reviewed-By: Gus Caplan me@gus.host Reviewed-By: Luigi Pinca luigipinca@gmail.com Reviewed-By: Yongsheng Zhang zyszys98@gmail.com Reviewed-By: Minwoo Jung minwoo@nodesource.com

This was referenced

Apr 23, 2019

Reviewers

@addaleax addaleax addaleax approved these changes

@santigimeno santigimeno santigimeno approved these changes

@lpinca lpinca lpinca approved these changes

@JungMinu JungMinu JungMinu approved these changes

@richardlau richardlau richardlau approved these changes

@devsnek devsnek devsnek approved these changes

@ZYSzys ZYSzys ZYSzys approved these changes

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++.

dgram

Issues and PRs related to the dgram subsystem / UDP.