diff --git a/docs/changes.txt b/docs/changes.txt index 6f3206e76..f14019f60 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -169,6 +169,7 @@ - Metal Backend: improved compute workloads calculation - Modules: Check UnpackSize to raise false positive with hc_decompress_rar - User Options: added --metal-compiler-runtime option +- User Options: limit --bitmap-max value to 31 - User Options: assigned -H to --hash-info - Hash-Info: show more details using -HH - Hardware Monitor: avoid sprintf in src/ext_iokit.c diff --git a/src/bitmap.c b/src/bitmap.c index 1652b7cb9..673629629 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -110,6 +110,8 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx) u32 *bitmap_s2_c = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); u32 *bitmap_s2_d = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + if (!bitmap_s1_a || !bitmap_s1_b || !bitmap_s1_c || !bitmap_s1_d || !bitmap_s2_a || !bitmap_s2_b || !bitmap_s2_c || !bitmap_s2_d) return -1; + u32 bitmap_bits; u32 bitmap_nums; u32 bitmap_mask; diff --git a/src/user_options.c b/src/user_options.c index 7e8ad2576..11720bd12 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -996,6 +996,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } + if (user_options->bitmap_max > 31) + { + event_log_error (hashcat_ctx, "Invalid --bitmap-max value specified - must be lower than 32."); + + return -1; + } + if (user_options->rp_gen_func_min > user_options->rp_gen_func_max) { event_log_error (hashcat_ctx, "Invalid --rp-gen-func-min value specified.");