1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-15 18:20:59 +00:00

Do not load data from hashfile if hashfile changed during runtime

This commit is contained in:
Jens Steube 2016-11-08 16:41:11 +01:00
parent c02a0cbf3f
commit 7958479b62

View File

@ -730,11 +730,18 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
break; break;
} }
if (hashes_avail == hashes_cnt)
{
event_log_warning (hashcat_ctx, "Hashfile '%s': File changed during runtime, skipping new data", hash_buf);
break;
}
parser_status = hashconfig->parse_func ((u8 *) in, hccap_size, &hashes_buf[hashes_cnt], hashconfig); parser_status = hashconfig->parse_func ((u8 *) in, hccap_size, &hashes_buf[hashes_cnt], hashconfig);
if (parser_status != PARSER_OK) if (parser_status != PARSER_OK)
{ {
event_log_warning (hashcat_ctx, "Hash '%s': %s", hash_buf, strparser (parser_status)); event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hash_buf, strparser (parser_status));
continue; continue;
} }
@ -829,6 +836,13 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
if (line_len == 0) continue; if (line_len == 0) continue;
if (hashes_avail == hashes_cnt)
{
event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u: File changed during runtime, skipping new data", hashes->hashfile, line_num);
break;
}
char *hash_buf = NULL; char *hash_buf = NULL;
int hash_len = 0; int hash_len = 0;