quic: fix up coverity warning in quic/session.cc#49865
Closed
mhdawson wants to merge 1 commit intonodejs:mainfrom
Closed
quic: fix up coverity warning in quic/session.cc#49865mhdawson wants to merge 1 commit intonodejs:mainfrom
mhdawson wants to merge 1 commit intonodejs:mainfrom
Conversation
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 <midawson@redhat.com>
Member
Author
|
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
Collaborator
Collaborator
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 <midawson@redhat.com> PR-URL: #49865 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Member
Author
|
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 <midawson@redhat.com> PR-URL: nodejs#49865 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.