From 539829b2842085a199b4e329ea688324776a024e Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 22 Jul 2026 18:08:15 +0000 Subject: [PATCH] Eliminate crash in mac_prefix_init() on platforms with 32-bit long. Closes #2732 --- CHANGELOG | 3 +++ MACLookup.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 782f4587b..9173e0593 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ #Nmap Changelog ($Id$); -*-text-*- +o [GH#2732] Fix a potential crash on 32-bit platforms in debug mode due to + incorrect format specifier for 64-bit integer type. [Christopher Chavez] + o [GH#3201][GH#3367] Increase line length limit for nmap-service-probes and correctly handle lines that are too long. [@liquidpele, Ashutosh Kumar Singh] diff --git a/MACLookup.cc b/MACLookup.cc index e3cfa6508..94b7d1de2 100644 --- a/MACLookup.cc +++ b/MACLookup.cc @@ -159,7 +159,7 @@ static void mac_prefix_init() { std::pair status = MacTable.insert(std::pair(pfx, string_pool_substr(vendor, endptr))); if (!status.second && o.debugging > 1) - error("MAC prefix %0*lX is duplicated in %s; ignoring duplicates.", (int)(pfx >> 36), pfx & 0xfffffffffL, filename); + error("MAC prefix %0*" PRIX64 " is duplicated in %s; ignoring duplicates.", (int)(pfx >> 36), pfx & 0xfffffffffL, filename); } fclose(fp);