mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-25 16:08:39 +00:00
[FIX] Prevent NULL dereference in read_restore() via hcmalloc
This commit is contained in:
parent
696fa3b2ad
commit
03ea85dc68
@ -89,6 +89,14 @@ static int read_restore (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
char *buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
|
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++)
|
for (u32 i = 0; i < rd->argc; i++)
|
||||||
{
|
{
|
||||||
if (hc_fgets (buf, HCBUFSIZ_LARGE - 1, &fp) == NULL)
|
if (hc_fgets (buf, HCBUFSIZ_LARGE - 1, &fp) == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user