diff --git a/src/user_options.c b/src/user_options.c index 4b4a7b9b6..dc838247e 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -281,6 +281,16 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) } } + if (optopt != 0) + { + event_log_error (hashcat_ctx, "Invalid argument specified"); + + return -1; + } + + optind = 1; + optopt = 0; + option_index = 0; while (((c = getopt_long (argc, argv, short_options, long_options, &option_index)) != -1) && optopt == 0)