From a788bd1a462d3d0ae631202224081b0262eadb8f Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 11 Aug 2007 06:12:14 +0000 Subject: [PATCH] merge soc07 r5322:5360 - fix a problem with RPCGrind time estimates -- the lines sometimes included junk chars on Windows because Windows snprintf doesn't always nul-terminate the strings --- scan_engine.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scan_engine.cc b/scan_engine.cc index 1dc90cf30..c2289036f 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -3829,8 +3829,9 @@ void pos_scan(Target *target, u16 *portarray, int numports, stype scantype) { // This initial message is way down here because we don't want to print it if // no RPC ports need scanning. if (!SPM) { - char scanname[32]; + char scanname[48]; snprintf(scanname, sizeof(scanname), "%s against %s", scantype2str(scantype), target->NameIP()); + scanname[sizeof(scanname) - 1] = '\0'; SPM = new ScanProgressMeter(scanname); }