From 141bb72624c101e12f2cb770f634bd45c433462e Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 11 Jun 2026 18:31:30 +0000 Subject: [PATCH] Fix undefined behavior iterator deref. Fixes #3378 --- osscan.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osscan.cc b/osscan.cc index d4f58f978..5957ea3b3 100644 --- a/osscan.cc +++ b/osscan.cc @@ -766,8 +766,8 @@ bool FingerTest::str2AVal(const char *str, const char *end) { return false; } std::map::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; }