ip a: fix SEGV if "dev IFACE" is not specified
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
21e8e8da64
commit
fd744519d1
@ -698,11 +698,10 @@ static int ipaddr_modify(int cmd, char **argv)
|
||||
argv++;
|
||||
}
|
||||
|
||||
// d cannot be null here, NEXT_ARG() of "dev" ensures that
|
||||
//if (d == NULL) {
|
||||
// bb_error_msg(bb_msg_requires_arg, "\"dev\"");
|
||||
// return -1;
|
||||
//}
|
||||
if (!d) {
|
||||
/* There was no "dev IFACE", but we need that */
|
||||
bb_error_msg_and_die("need \"dev IFACE\"");
|
||||
}
|
||||
if (l && strncmp(d, l, strlen(d)) != 0) {
|
||||
bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s)", d, l);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user