mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -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
|
// The line start with # is comment, skip
|
||||||
line[keylen] = 0;
|
if (line[0] == '#') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove newline/linefeed
|
||||||
|
str_cleanrn(line, strlen(line));
|
||||||
|
|
||||||
// smaller keys than expected is skipped
|
// smaller keys than expected is skipped
|
||||||
if (strlen(line) < keylen) {
|
if (strlen(line) < keylen) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The line start with # is comment, skip
|
// larger keys than expected is skipped
|
||||||
if (line[0] == '#') {
|
if (strlen(line) > keylen) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue