Skip to content

Conversation

@mhdawson
Copy link
Member

  • add CHECK around SocketAddress::New like we have in other places as suggested by Coverity scan

- add CHECK around SocketAddress::New like we have in other places as suggested by Coverity scan Signed-off-by: Michael Dawson <[email protected]>
@nodejs-github-botnodejs-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. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Sep 25, 2023
@mhdawson
Copy link
MemberAuthor

Coverity report:

02case AF_INET:{1303auto ipv4 = preferredAddress->ipv4(); 1304if (ipv4.has_value()){1305if (ipv4->address.empty() || ipv4->port == 0) return; CID 318341 (#1 of 2): Unchecked returnvalue (CHECKED_RETURN) [[select issue](https://scan9.scan.coverity.com/defectInstanceId=9078846&fileInstanceId=114681342&mergedDefectId=318341)]1306SocketAddress::New(AF_INET, 1307std::string(ipv4->address).c_str(), 1308 ipv4->port, 1309 &remote_address_); 1310 preferredAddress->Use(ipv4.value()); 1311 } 1312break; 1313 } 1314case AF_INET6:{1315auto ipv6 = preferredAddress->ipv6(); 3. Condition ipv6.has_value(), taking true branch. 1316if (ipv6.has_value()){4. Condition ipv6->address.empty(), taking false branch. 5. Condition ipv6->port == 0, taking false branch. 1317if (ipv6->address.empty() || ipv6->port == 0) return; CID 318341 (#2 of 2): Unchecked returnvalue (CHECKED_RETURN) 6. check_return: Calling New without checking returnvalue (as is done elsewhere 9 out of 11 times). 1318SocketAddress::New(AF_INET, 1319std::string(ipv6->address).c_str(), 1320 ipv6->port, 1321 &remote_address_); 1322 preferredAddress->Use(ipv6.value()); 1323 } 1324 br

@mhdawsonmhdawson added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

mhdawson added a commit that referenced this pull request Oct 12, 2023
- add CHECK around SocketAddress::New like we have in other places as suggested by Coverity scan Signed-off-by: Michael Dawson <[email protected]> PR-URL: #49865 Reviewed-By: Tobias Nießen <[email protected]>
@mhdawson
Copy link
MemberAuthor

Landed in 971af4b

alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
- add CHECK around SocketAddress::New like we have in other places as suggested by Coverity scan Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#49865 Reviewed-By: Tobias Nießen <[email protected]>
@targostargos added dont-land-on-v18.x dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. labels Nov 11, 2023
Sign up for freeto 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++.dont-land-on-v20.xPRs that should not land on the v20.x-staging branch and should not be released in v20.x.needs-ciPRs that need a full CI run.quicIssues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mhdawson@nodejs-github-bot@tniessen@targos