diff --git a/src/combinator.c b/src/combinator.c index a0c3f16eb..a8fd4f3ef 100644 --- a/src/combinator.c +++ b/src/combinator.c @@ -111,13 +111,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -125,15 +125,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2; @@ -220,13 +214,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -234,15 +228,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2; @@ -357,13 +345,13 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt); + fclose (fp1); + fclose (fp2); + if (rc2 == -1) { event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } @@ -371,15 +359,9 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "%s: empty file.", dictfile2); - fclose (fp1); - fclose (fp2); - return -1; } - fclose (fp1); - fclose (fp2); - combinator_ctx->dict1 = dictfile1; combinator_ctx->dict2 = dictfile2;