svn commit: r256137 - head/sbin/route
Gleb Smirnoff
glebius at FreeBSD.org
Tue Oct 8 08:16:18 UTC 2013
Author: glebius
Date: Tue Oct 8 08:16:17 2013
New Revision: 256137
URL: http://svnweb.freebsd.org/changeset/base/256137
Log:
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)
Modified:
head/sbin/route/route.c
Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c Tue Oct 8 07:02:23 2013 (r256136)
+++ head/sbin/route/route.c Tue Oct 8 08:16:17 2013 (r256137)
@@ -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
More information about the svn-src-all
mailing list