mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
fix length check when reading a dictionary file
This commit is contained in:
parent
5b1fadb7c6
commit
9c9b2b2ad0
1 changed files with 9 additions and 4 deletions
|
@ -2385,16 +2385,21 @@ int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, vo
|
|||
}
|
||||
}
|
||||
|
||||
// add null terminator
|
||||
line[keylen] = 0;
|
||||
// The line start with # is comment, skip
|
||||
if (line[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// remove newline/linefeed
|
||||
str_cleanrn(line, strlen(line));
|
||||
|
||||
// smaller keys than expected is skipped
|
||||
if (strlen(line) < keylen) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// The line start with # is comment, skip
|
||||
if (line[0] == '#') {
|
||||
// larger keys than expected is skipped
|
||||
if (strlen(line) > keylen) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue