Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2013 08:16:18 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256137 - head/sbin/route
Message-ID:  <201310080816.r988GIxn061511@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310080816.r988GIxn061511>