mirror of
https://github.com/troglobit/libite.git
synced 2026-10-05 06:53:41 +07:00
ifconfig.c: Fix possible NULL pointer deref.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ int ifconfig(char *ifname, char *addr, char *mask, int up)
|
||||
}
|
||||
|
||||
/* Non-zero IP address */
|
||||
if (mask && strcmp(addr, "0.0.0.0")) {
|
||||
if (mask && addr && strcmp(addr, "0.0.0.0")) {
|
||||
if (inet_pton(AF_INET, mask, &sin->sin_addr) == -1)
|
||||
ret = ioctl(sd, SIOCSIFNETMASK, &ifr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user