summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Graf <tgr@lsx.localdomain>2008-04-30 16:50:52 (GMT)
committerThomas Graf <tgr@lsx.localdomain>2008-04-30 16:50:52 (GMT)
commit182608e23629781698756aaf36c1db4ba888626f (patch)
treea91b3561ae1eaf5128112e30e16e08bf2351044d /src
parent6d9d3d54750c1d8a9c90c463cc1d58a447c98f64 (diff)
downloadlibnl-182608e23629781698756aaf36c1db4ba888626f.zip
libnl-182608e23629781698756aaf36c1db4ba888626f.tar.gz
libnl-182608e23629781698756aaf36c1db4ba888626f.tar.bz2
Fix segfault nexthop parsing when no option is given
Diffstat (limited to 'src')
-rw-r--r--src/route-utils.c4
1 files changed, 4 insertions, 0 deletions
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);