mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 23:19:09 +00:00
Merge pull request #1092 from philsmd/master
fix our usage of strtok_r (), it was not 100% correct
This commit is contained in:
commit
f9bbd42b4a
@ -63,7 +63,7 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
char *devices = hcstrdup (user_options->cpu_affinity);
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
char *next = strtok_r (devices, ",", &saveptr);
|
||||
|
||||
|
@ -5112,7 +5112,9 @@ int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE
|
||||
|
||||
size_t in_len[9] = { 0 };
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
if (input_buf == NULL) return (PARSER_HASH_VALUE);
|
||||
|
||||
in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr);
|
||||
|
||||
@ -5198,7 +5200,9 @@ int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB
|
||||
|
||||
size_t in_len[9] = { 0 };
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
if (input_buf == NULL) return (PARSER_HASH_VALUE);
|
||||
|
||||
in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr);
|
||||
|
||||
@ -22507,10 +22511,17 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
char *keyfiles = hcstrdup (tcvc_keyfiles);
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
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);
|
||||
|
@ -180,7 +180,7 @@ static int setup_opencl_platforms_filter (hashcat_ctx_t *hashcat_ctx, const char
|
||||
{
|
||||
char *platforms = hcstrdup (opencl_platforms);
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
char *next = strtok_r (platforms, ",", &saveptr);
|
||||
|
||||
@ -221,7 +221,7 @@ static int setup_devices_filter (hashcat_ctx_t *hashcat_ctx, const char *opencl_
|
||||
{
|
||||
char *devices = hcstrdup (opencl_devices);
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
char *next = strtok_r (devices, ",", &saveptr);
|
||||
|
||||
@ -262,7 +262,7 @@ static int setup_device_types_filter (hashcat_ctx_t *hashcat_ctx, const char *op
|
||||
{
|
||||
char *device_types = hcstrdup (opencl_device_types);
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
char *next = strtok_r (device_types, ",", &saveptr);
|
||||
|
||||
|
@ -119,7 +119,7 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
int token_cnt = 0;
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *saveptr;
|
||||
|
||||
char *next = strtok_r (line_buf, "\t ", &saveptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user