1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Fixed parsing of hashes in case the last line did not include a linefeed character

This commit is contained in:
jsteube 2017-01-05 21:58:24 +01:00
parent e5e97c6ff8
commit 992bc01f3c
2 changed files with 17 additions and 11 deletions

View File

@ -32,6 +32,7 @@
- Fixed infinite loop when using --loopback in case all hashes have been cracked
- Fixed kernel loops in --increment mode leading to slower performance
- Fixed mask length check in hybrid attack-modes: Do not include hash-mode dependant mask length checks
- Fixed parsing of hashes in case the last line did not include a linefeed character
- Fixed potfile loading to accept blank passwords
##

View File

@ -58,21 +58,26 @@ int fgetl (FILE *fp, char *line_buf)
if (line_len == 0) return 0;
if (line_buf[line_len - 1] == '\n')
while (line_len)
{
line_len--;
if (line_buf[line_len - 1] == '\n')
{
line_len--;
line_buf[line_len] = 0;
continue;
}
if (line_buf[line_len - 1] == '\r')
{
line_len--;
continue;
}
break;
}
if (line_len == 0) return 0;
if (line_buf[line_len - 1] == '\r')
{
line_len--;
line_buf[line_len] = 0;
}
line_buf[line_len] = 0;
return (line_len);
}