From 3bf351b29a026b91740a411c4f0d5e85901e4e2a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 8 Oct 2013 08:16:17 +0000 Subject: [PATCH] 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 Approved by: re (hrs) --- sbin/route/route.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/route/route.c b/sbin/route/route.c index e575c711329..6c2bbe2084b 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -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