improve command line argument checking
authorNils Larsch <nils@openssl.org>
Tue, 10 May 2005 09:51:29 +0000 (09:51 +0000)
committerNils Larsch <nils@openssl.org>
Tue, 10 May 2005 09:51:29 +0000 (09:51 +0000)
PR: 1061

apps/engine.c

index 8f7b389..25c8617 100644 (file)
@@ -394,11 +394,15 @@ int MAIN(int argc, char **argv)
                else if (strcmp(*argv,"-pre") == 0)
                        {
                        argc--; argv++;
+                       if (argc == 0)
+                               goto skip_arg_loop;
                        sk_push(pre_cmds,*argv);
                        }
                else if (strcmp(*argv,"-post") == 0)
                        {
                        argc--; argv++;
+                       if (argc == 0)
+                               goto skip_arg_loop;
                        sk_push(post_cmds,*argv);
                        }
                else if ((strncmp(*argv,"-h",2) == 0) ||