Fix undefined behavior iterator deref. Fixes #3378

This commit is contained in:
dmiller 2026-06-11 18:31:30 +00:00
parent a36249fdda
commit 141bb72624

View file

@ -766,8 +766,8 @@ bool FingerTest::str2AVal(const char *str, const char *end) {
return false;
}
std::map<FPstr, u8>::const_iterator idx = def->AttrIdx.find(FPstr(p, q));
u8 j = idx->second;
if (idx == def->AttrIdx.end() || AVs[j] != NULL) {
u8 j = 0;
if (idx == def->AttrIdx.end() || AVs[(j = idx->second)] != NULL) {
error("Parse error with AVal string (%s) in nmap-os-db file", str);
return false;
}