Browse code

bb11904 - ensuring md5 hashset string is initialized before use

Mickey Sola authored on 2017/08/25 06:23:38
Showing 1 changed files
... ...
@@ -2528,7 +2528,7 @@ static int scan_pe_imp(cli_ctx *ctx, struct pe_image_data_dir *dirs, struct cli_
2528 2528
     if (cli_debug_flag && !genhash[CLI_HASH_MD5]) {
2529 2529
 #endif
2530 2530
         genhash[CLI_HASH_MD5] = 1;
2531
-        hashset[CLI_HASH_MD5] = cli_malloc(hashlen[CLI_HASH_MD5]);
2531
+        hashset[CLI_HASH_MD5] = cli_calloc(hashlen[CLI_HASH_MD5], sizeof(char));
2532 2532
         if(!hashset[CLI_HASH_MD5]) {
2533 2533
             cli_errmsg("scan_pe: cli_malloc failed!\n");
2534 2534
             for(type = CLI_HASH_MD5; type < CLI_HASH_AVAIL_TYPES; type++)