From 971af4b211921f807589b35aaf1bf8111391720a Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 25 Sep 2023 20:32:21 +0000 Subject: [PATCH] quic: fix up coverity warning in quic/session.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add CHECK around SocketAddress::New like we have in other places as suggested by Coverity scan Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/49865 Reviewed-By: Tobias Nießen --- src/quic/session.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/quic/session.cc b/src/quic/session.cc index 73ca658e3ed062..b4a3ea796f338b 100644 --- a/src/quic/session.cc +++ b/src/quic/session.cc @@ -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; @@ -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;