Bug 1027300: Check for ioctl error return. r=mt
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 29 Aug 2014 13:40:15 -0700
changeset 204590 c220f15e006bddeef8c4415169a1ecb27db2d950
parent 204589 075a07c452d28bb7265bf307cbd242c724935d35
child 204591 5cc6fa50f4b60228cef716e7e793959836c88374
push id48959
push userbcampen@mozilla.com
push dateWed, 10 Sep 2014 19:40:43 +0000
treeherdermozilla-inbound@c220f15e006b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt
bugs1027300
milestone35.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 1027300: Check for ioctl error return. r=mt
media/mtransport/third_party/nICEr/src/stun/addrs.c
--- a/media/mtransport/third_party/nICEr/src/stun/addrs.c
+++ b/media/mtransport/third_party/nICEr/src/stun/addrs.c
@@ -610,16 +610,22 @@ stun_get_siocgifconf_addrs(nr_local_addr
    struct ifreq ifr2;
 
    char buf[ len ];
 
    ifc.ifc_len = len;
    ifc.ifc_buf = buf;
 
    e = ioctl(s,SIOCGIFCONF,&ifc);
+
+   if ( e == -1 )
+   {
+      return(R_INTERNAL);
+   }
+
    ptr = buf;
    tl = ifc.ifc_len;
    n=0;
 
    while ( (tl > 0) && ( n < maxaddrs) )
    {
       struct ifreq* ifr = (struct ifreq *)ptr;