ipconfig: Check for NULL pointers before calling inet_pton on them
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 15 Apr 2011 18:17:05 +0000 (20:17 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 17 Apr 2011 15:25:41 +0000 (17:25 +0200)
src/ipconfig.c

index 92ac8f6..616cbcb 100644 (file)
@@ -145,6 +145,9 @@ static gboolean check_ipv6_address(const char *address)
        unsigned char buf[sizeof(struct in6_addr)];
        int err;
 
+       if (address == NULL)
+               return FALSE;
+
        err = inet_pton(AF_INET6, address, buf);
        if (err > 0)
                return TRUE;