Skip to content

Commit

Permalink
quic: fix up coverity warning in quic/session.cc
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
mhdawson authored and alexfernandez committed Nov 1, 2023
1 parent 6e88292 commit 1279eb6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/quic/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,10 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
auto ipv4 = preferredAddress->ipv4();
if (ipv4.has_value()) {
if (ipv4->address.empty() || ipv4->port == 0) return;
SocketAddress::New(AF_INET,
std::string(ipv4->address).c_str(),
ipv4->port,
&remote_address_);
CHECK(SocketAddress::New(AF_INET,
std::string(ipv4->address).c_str(),
ipv4->port,
&remote_address_));
preferredAddress->Use(ipv4.value());
}
break;
Expand All @@ -1315,10 +1315,10 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
auto ipv6 = preferredAddress->ipv6();
if (ipv6.has_value()) {
if (ipv6->address.empty() || ipv6->port == 0) return;
SocketAddress::New(AF_INET,
std::string(ipv6->address).c_str(),
ipv6->port,
&remote_address_);
CHECK(SocketAddress::New(AF_INET,
std::string(ipv6->address).c_str(),
ipv6->port,
&remote_address_));
preferredAddress->Use(ipv6.value());
}
break;
Expand Down

0 comments on commit 1279eb6

Please sign in to comment.