1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-24 15:38:47 +00:00

[FIX] Prevent NULL dereference in read_restore() via hcmalloc

This commit is contained in:
엄태용 2025-07-01 18:26:07 +09:00
parent 696fa3b2ad
commit 03ea85dc68

View File

@ -89,6 +89,14 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx)
char *buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
if (buf == NULL)
{
event_log_error(hashcat_ctx, "hcmalloc: %s", strerror(errno));
hc_fclose(&fp);
hcfree(rd->argv);
return -1;
}
for (u32 i = 0; i < rd->argc; i++)
{
if (hc_fgets (buf, HCBUFSIZ_LARGE - 1, &fp) == NULL)