]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[CID 6] Fix a possible null dereference
authorHarlan Stenn <stenn@ntp.org>
Sat, 9 Sep 2006 01:33:04 +0000 (21:33 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 9 Sep 2006 01:33:04 +0000 (21:33 -0400)
bk: 450219d0uxOL8Ps59kdW1cBWYNVl8A

ntpd/ntp_io.c

index 9e4d7b29f9e8cd53b085aea3d42b55c46c932f0a..0996e61dd1f1bc7a913dc21c037a5c18b67a5861 100644 (file)
@@ -1908,12 +1908,12 @@ io_multicast_add(
                memset(&((struct sockaddr_in6*)&interface->mask)->sin6_addr.s6_addr, 0xff, sizeof(struct in6_addr));
 #endif
                iface = findlocalcastinterface(&addr, INT_MULTICAST);
-# ifdef ISC_PLATFORM_HAVESCOPEID
                if (iface) {
+# ifdef ISC_PLATFORM_HAVESCOPEID
                        lscope = ((struct sockaddr_in6*)&iface->sin)->sin6_scope_id;
-               }
 # endif
-               DPRINTF(4, ("Found interface #%d %s, scope: %d for address %s\n", iface->ifnum, iface->name, lscope, stoa(&addr)));
+                       DPRINTF(4, ("Found interface #%d %s, scope: %d for address %s\n", iface->ifnum, iface->name, lscope, stoa(&addr)));
+               }
                break;
        }