Permalink
Browse files

When destination parameter is missing, exit with a clear synopsis,

instead of writing to kernel and printing EINVAL description.

PR:		bin/181532
Submitted by:	Kurt Jaeger <fbsd-pr opsec.eu>
Approved by:	re (hrs)
  • Loading branch information...
1 parent 41bda5b commit f1b97b5667257dbd0ec9f0ea453e41233f1cc9c7 @glebius glebius committed Oct 8, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 sbin/route/route.c
View
@@ -928,6 +928,11 @@ newroute(int argc, char **argv)
}
}
+ if (so[RTAX_DST].ss_len == 0) {
+ warnx("destination parameter required");
+ usage(NULL);
+ }
+
if (nrflags & F_FORCEHOST) {
nrflags |= F_ISHOST;
#ifdef INET6

0 comments on commit f1b97b5

Please sign in to comment.