dect
/
libnl
Archived
13
0
Fork 0

Fix segfault nexthop parsing when no option is given

This commit is contained in:
Thomas Graf 2008-04-30 18:50:52 +02:00
parent 6d9d3d5475
commit 182608e236
1 changed files with 4 additions and 0 deletions

View File

@ -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);