From 182608e23629781698756aaf36c1db4ba888626f Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Wed, 30 Apr 2008 18:50:52 +0200 Subject: [PATCH] Fix segfault nexthop parsing when no option is given --- src/route-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/route-utils.c b/src/route-utils.c index 61bc9cd..7f73a41 100644 --- a/src/route-utils.c +++ b/src/route-utils.c @@ -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);