diff options
author | glebius <glebius@FreeBSD.org> | 2013-10-08 08:16:17 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-10-08 08:16:17 +0000 |
commit | f1b97b5667257dbd0ec9f0ea453e41233f1cc9c7 (patch) | |
tree | 4d61a5cd0ca271961e2e601fdc5c7949a04d45c0 | |
parent | 41bda5b66a85fa1d81383cb9d4cea33a31a88a61 (diff) | |
download | FreeBSD-src-f1b97b5667257dbd0ec9f0ea453e41233f1cc9c7.zip FreeBSD-src-f1b97b5667257dbd0ec9f0ea453e41233f1cc9c7.tar.gz |
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)
-rw-r--r-- | sbin/route/route.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index e575c71..6c2bbe2 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 |