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

apps/engine.c

index 12283d0aed6723886f964dc546da8eb89993b95a..e8a599f9e590d9a2fece662b7296e0c8b1335f66 100644 (file)
@@ -387,11 +387,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) ||