Merge pull request #2861 from jtojanen/fixes

Fix iconv_ctx and iconv_tmp leaks in backend.c
pull/2863/head
Jens Steube 3 years ago committed by GitHub
commit d99b4cf46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4514,7 +4514,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
iconv_t iconv_ctx = NULL;
char *iconv_tmp = NULL;
char iconv_tmp[HCBUFSIZ_TINY] = { 0 };
if (strcmp (user_options->encoding_from, user_options->encoding_to) != 0)
{
@ -4523,8 +4523,6 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
iconv_ctx = iconv_open (user_options->encoding_to, user_options->encoding_from);
if (iconv_ctx == (iconv_t) -1) return -1;
iconv_tmp = (char *) hcmalloc (HCBUFSIZ_TINY);
}
// find higest password length, this is for optimization stuff
@ -5160,6 +5158,11 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
device_param->speed_only_finish = true;
}
if (iconv_enabled == true)
{
iconv_close (iconv_ctx);
}
return 0;
}

Loading…
Cancel
Save