Bug 1296716 - Uninitialised value uses somehow relating to nsSocketTransportService::AnalyzeConnection. r=valentin.gosu@gmail.com.
authorJulian Seward <jseward@acm.org>
Sat, 10 Sep 2016 08:16:14 +0200
changeset 356958 b02007bc6c6aff056061b184a1dc10df7dc4269f
parent 356940 1fcda39e5626b8e35d7218303fd66f7c7d4d68ab
child 356959 0e8f7203191d83d7adc0bd4b49a6e8ccaf1463ee
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin.gosu
bugs1296716
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1296716 - Uninitialised value uses somehow relating to nsSocketTransportService::AnalyzeConnection. r=valentin.gosu@gmail.com.
netwerk/base/nsSocketTransportService2.cpp
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -1493,20 +1493,25 @@ nsSocketTransportService::AnalyzeConnect
 
     PRFileDesc *idLayer = PR_GetIdentitiesLayer(aFD, PR_NSPR_IO_LAYER);
 
     NS_ENSURE_TRUE_VOID(idLayer);
 
     bool tcp = PR_GetDescType(idLayer) == PR_DESC_SOCKET_TCP;
 
     PRNetAddr peer_addr;
-    PR_GetPeerName(aFD, &peer_addr);
+    PodZero(&peer_addr);
+    PRStatus rv = PR_GetPeerName(aFD, &peer_addr);
+    if (rv != PR_SUCCESS)
+       return;
 
     char host[64] = {0};
-    PR_NetAddrToString(&peer_addr, host, sizeof(host));
+    rv = PR_NetAddrToString(&peer_addr, host, sizeof(host));
+    if (rv != PR_SUCCESS)
+       return;
 
     uint16_t port;
     if (peer_addr.raw.family == PR_AF_INET)
         port = peer_addr.inet.port;
     else
         port = peer_addr.ipv6.port;
     port = PR_ntohs(port);
     uint64_t sent = context->mHandler->ByteCountSent();