Skip to content

Commit

Permalink
NetworkRTCTCPSocketCocoa should send the interface name to its WebPro…
Browse files Browse the repository at this point in the history
…cess if not null

https://bugs.webkit.org/show_bug.cgi?id=259554
rdar://112931044

Reviewed by Alex Christensen.

nw_interface_get_name can return null, in which case sending a null string to the WebProcess is neither good nor useful.

* Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):

Canonical link: https://commits.webkit.org/266360@main
  • Loading branch information
youennf committed Jul 27, 2023
1 parent 3796f23 commit 7c4c435
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ static inline void processIncomingData(RetainPtr<nw_connection_t>&& nwConnection
return;
auto path = adoptNS(nw_connection_copy_current_path(weakThis->m_nwConnection.get()));
auto interface = adoptNS(nw_path_copy_interface(path.get()));
auto* name = nw_interface_get_name(interface.get());
connection->send(Messages::LibWebRTCNetwork::SignalUsedInterface(identifier, String::fromUTF8(name)), 0);
if (auto* name = nw_interface_get_name(interface.get()))
connection->send(Messages::LibWebRTCNetwork::SignalUsedInterface(identifier, String::fromUTF8(name)), 0);
});
connection->send(Messages::LibWebRTCNetwork::SignalConnect(identifier), 0);
return;
Expand Down

0 comments on commit 7c4c435

Please sign in to comment.