mirror of
https://github.com/nmap/nmap.git
synced 2026-09-02 00:11:04 +00:00
Ensure str2AVal resets existing values and detects too-long inputs
This commit is contained in:
parent
06e6700268
commit
18a05139be
1 changed files with 5 additions and 0 deletions
|
|
@ -608,6 +608,7 @@ bool FingerTest::str2AVal(const char *str, const char *end) {
|
|||
}
|
||||
u8 count = def->numAttrs;
|
||||
std::vector<const char *> &AVs = *results;
|
||||
for (u8 i = 0; i < count; i++) AVs[i] = NULL;
|
||||
|
||||
for (u8 i = 0; i < count && p < end; i++) {
|
||||
q = strchr_p(p, end, '=');
|
||||
|
|
@ -629,6 +630,10 @@ bool FingerTest::str2AVal(const char *str, const char *end) {
|
|||
AVs[idx->second] = string_pool_substr(p, q);
|
||||
p = q + 1;
|
||||
}
|
||||
if (p < end) {
|
||||
error("Too many values in AVal string (%s)", str);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue