[Turqstat-commits] [SCM] Turquoise SuperStat - http://www.softwolves.pp.se/sw/software/turquoise branch, xturqstat-win32, updated. release-3.0-2-11-g836657e

Peter Karlsson peter at softwolves.pp.se
Sun Mar 23 22:32:13 UTC 2008


The following commit has been merged in the xturqstat-win32 branch:
commit 58118e718396ce9b32ed359e54fb3968c8bdb134
Author: Peter Karlsson <peter at softwolves.pp.se>
Date:   Sun Mar 23 23:21:55 2008 +0100

    Fixed out-of-bounds addressing when no program name was located.

diff --git a/statengine.cpp b/statengine.cpp
index a11c39c..63dd3dd 100644
--- a/statengine.cpp
+++ b/statengine.cpp
@@ -741,11 +741,12 @@ void StatEngine::AddData(string in_fromname, string in_toname, string in_subject
         if (paren != string::npos && paren < space1) space1 = paren;
 
         // Special case: "Gnus v#.##/Emacs..."
-        if ('v' == program[firstspace + 1] &&
+		if (firstspace && 'v' == program[firstspace + 1] &&
             isdigit(program[firstspace + 2]))
             space1 = firstspace;
 
-        if (versionstring > firstspace && ' ' == program[versionstring + 7])
+		if (versionstring != string::npos &&
+		    versionstring > firstspace && ' ' == program[versionstring + 7])
             space1 = versionstring + 7;
         else
             versionstring = string::npos;

-- 
Turquoise SuperStat - http://www.softwolves.pp.se/sw/software/turquoise



More information about the Turqstat-commits mailing list