-
Notifications
You must be signed in to change notification settings - Fork 30k
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
quic: fix up coverity warning in quic/session.cc #49865
Closed
Closed
Conversation
This file contains 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
Member
mhdawson
commented
Sep 25, 2023
- 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-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
Coverity report: 02 case AF_INET: {
1303 auto ipv4 = preferredAddress->ipv4();
1304 if (ipv4.has_value()) {
1305 if (ipv4->address.empty() || ipv4->port == 0) return;
CID 318341 (#1 of 2): Unchecked return value (CHECKED_RETURN) [[select issue](https://scan9.scan.coverity.com/defectInstanceId=9078846&fileInstanceId=114681342&mergedDefectId=318341)]
1306 SocketAddress::New(AF_INET,
1307 std::string(ipv4->address).c_str(),
1308 ipv4->port,
1309 &remote_address_);
1310 preferredAddress->Use(ipv4.value());
1311 }
1312 break;
1313 }
1314 case AF_INET6: {
1315 auto ipv6 = preferredAddress->ipv6();
3. Condition ipv6.has_value(), taking true branch.
1316 if (ipv6.has_value()) {
4. Condition ipv6->address.empty(), taking false branch.
5. Condition ipv6->port == 0, taking false branch.
1317 if (ipv6->address.empty() || ipv6->port == 0) return;
CID 318341 (#2 of 2): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling New without checking return value (as is done elsewhere 9 out of 11 times).
1318 SocketAddress::New(AF_INET,
1319 std::string(ipv6->address).c_str(),
1320 ipv6->port,
1321 &remote_address_);
1322 preferredAddress->Use(ipv6.value());
1323 }
1324 br |
tniessen
approved these changes
Sep 25, 2023
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Sep 28, 2023
This was referenced Sep 30, 2023
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]>
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]>
targos
added
dont-land-on-v18.x
PRs that should not land on the v18.x-staging branch and should not be released in 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 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++.
dont-land-on-v18.x
PRs that should not land on the v18.x-staging branch and should not be released in 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.
needs-ci
PRs that need a full CI run.
quic
Issues and PRs related to the QUIC implementation / HTTP/3.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.