chiark / gitweb /
regress: fuzz: Reject argc==0
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Dec 2016 00:07:34 +0000 (00:07 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
regress/hfuzz.c

index 4b50066..5d23368 100644 (file)
@@ -103,6 +103,7 @@ int main(int argc, char **argv) {
   if (!stdoutcopy) baile("fdopen 1 again");
 
   t_argc = getint(50);
+  if (!t_argc) bail("too few arguments");
   t_argv = calloc(t_argc+1, sizeof(*t_argv));
   for (i=0; i<t_argc; i++) {
     l = getint(1000);