Fail if address, netmask or gateway are not provided
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Oct 2008 12:21:02 +0000 (14:21 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Oct 2008 12:21:02 +0000 (14:21 +0200)
plugins/ipv4.c

index 0a66a23..67d1ed1 100644 (file)
@@ -192,6 +192,9 @@ static int ipv4_probe(struct connman_element *element)
        DBG("netmask %s", netmask);
        DBG("gateway %s", gateway);
 
+       if (address == NULL || netmask == NULL || gateway == NULL)
+               return -EINVAL;
+
        memset(&ipv4, 0, sizeof(ipv4));
        ipv4.address.s_addr = inet_addr(address);
        ipv4.netmask.s_addr = inet_addr(netmask);