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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to