Fix segfault nexthop parsing when no option is given
This commit is contained in:
parent
6d9d3d5475
commit
182608e236
1 changed files with 4 additions and 0 deletions
|
@ -134,6 +134,10 @@ void parse_nexthop(struct rtnl_route *route, char *subopts,
|
|||
if (ret == -1)
|
||||
fatal(EINVAL, "Unknown nexthop token \"%s\"", arg);
|
||||
|
||||
if (arg == NULL)
|
||||
fatal(EINVAL, "Missing argument to option \"%s\"\n",
|
||||
tokens[ret]);
|
||||
|
||||
switch (ret) {
|
||||
case NH_DEV:
|
||||
ival = rtnl_link_name2i(link_cache, arg);
|
||||
|
|
Loading…
Add table
Reference in a new issue