]> granicus.if.org Git - libnl/commitdiff
Fix segfault nexthop parsing when no option is given
authorThomas Graf <tgr@lsx.localdomain>
Wed, 30 Apr 2008 16:50:52 +0000 (18:50 +0200)
committerThomas Graf <tgr@lsx.localdomain>
Wed, 30 Apr 2008 16:50:52 +0000 (18:50 +0200)
src/route-utils.c

index 61bc9cd697daeaffdbbca89ce001bb67751c8058..7f73a41bf2fd678edb5aad8fc13f3aade634c147 100644 (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);