From: Marcel Holtmann Date: Tue, 7 Oct 2008 12:21:02 +0000 (+0200) Subject: Fail if address, netmask or gateway are not provided X-Git-Tag: 0.1~178 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=6fa6bdc6f6a8d239142b32979318245da8941d2b;p=connman Fail if address, netmask or gateway are not provided --- diff --git a/plugins/ipv4.c b/plugins/ipv4.c index 0a66a23..67d1ed1 100644 --- a/plugins/ipv4.c +++ b/plugins/ipv4.c @@ -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);