mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-17 01:52:06 +00:00
Fix some code in potfile.c to make cppcheck happy
This commit is contained in:
parent
733a7385b4
commit
0cd39ab963
@ -320,7 +320,7 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
int iter = MAX_CUT_TRIES;
|
||||
|
||||
for (int i = line_len - 1; i && iter; i--, line_len--)
|
||||
for (int i = line_len - 1; i && iter; i--, iter--, line_len--)
|
||||
{
|
||||
if (line_buf[i] != ':') continue;
|
||||
|
||||
@ -355,9 +355,10 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
// here we have in line_buf: ESSID:MAC1:MAC2 (without the plain)
|
||||
// manipulate salt_buf
|
||||
|
||||
memset (line_buf_cpy, 0, HCBUFSIZ_LARGE);
|
||||
memcpy (line_buf_cpy, line_buf, i);
|
||||
|
||||
line_buf_cpy[i] = 0;
|
||||
|
||||
char *mac2_pos = strrchr (line_buf_cpy, ':');
|
||||
|
||||
if (mac2_pos == NULL) continue;
|
||||
@ -451,9 +452,7 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
found->cracked = 1;
|
||||
|
||||
if (found) break;
|
||||
|
||||
iter--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user