mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-11 08:10:59 +00:00
also double-check input/output of strtok_r ()
This commit is contained in:
parent
a82f6fb77c
commit
12047861c5
@ -5114,6 +5114,8 @@ int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE
|
||||
|
||||
char *saveptr;
|
||||
|
||||
if (input_buf == NULL) return (PARSER_HASH_VALUE);
|
||||
|
||||
in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr);
|
||||
|
||||
if (in_off[0] == NULL) return (PARSER_SEPARATOR_UNMATCHED);
|
||||
@ -5200,6 +5202,8 @@ int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB
|
||||
|
||||
char *saveptr;
|
||||
|
||||
if (input_buf == NULL) return (PARSER_HASH_VALUE);
|
||||
|
||||
in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr);
|
||||
|
||||
if (in_off[0] == NULL) return (PARSER_SEPARATOR_UNMATCHED);
|
||||
@ -22511,6 +22515,13 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
char *keyfile = strtok_r (keyfiles, ",", &saveptr);
|
||||
|
||||
if (keyfile == NULL)
|
||||
{
|
||||
free (keyfiles);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
const int rc_crc32 = cpu_crc32 (hashcat_ctx, keyfile, (u8 *) keyfile_buf);
|
||||
|
Loading…
Reference in New Issue
Block a user