summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-04-02 07:20:56 +0000
committerjmallett <jmallett@FreeBSD.org>2002-04-02 07:20:56 +0000
commit390ab130a1f2e44b7ed3f277229568e1014849c8 (patch)
tree173cc1cca39fb1a9a8b7e0cfdd93ff86d09a7a99 /usr.bin/find
parentdc856893255e042cf63790d720621bfb4da67e18 (diff)
downloadFreeBSD-src-390ab130a1f2e44b7ed3f277229568e1014849c8.zip
FreeBSD-src-390ab130a1f2e44b7ed3f277229568e1014849c8.tar.gz
Fix find -exec with no command specified (i.e.: find . -exec ';')
PR: bin/36521 Submitted by: Simon 'corecode' Schubert <corecode@corecode.ath.cx> Reviewed by: mike MFC after: 3 days
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/function.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 81b3475..4fe27dc 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -597,6 +597,9 @@ c_exec(option, argvp)
break;
}
+ if (ap == argv)
+ errx(1, "%s: no command specified", option->name);
+
cnt = ap - *argvp + 1;
if ((new->e_argv = malloc((u_int)cnt * sizeof(char *))) == NULL)
err(1, (char *)NULL);
OpenPOWER on IntegriCloud