[Box Backup-commit] COMMIT r972 - box/chris/general/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed Oct 11 22:59:20 BST 2006


Author: chris
Date: 2006-10-11 22:59:20 +0100 (Wed, 11 Oct 2006)
New Revision: 972

Modified:
   box/chris/general/lib/common/DebugMemLeakFinder.cpp
Log:
- Avoid memory corruption


Modified: box/chris/general/lib/common/DebugMemLeakFinder.cpp
===================================================================
--- box/chris/general/lib/common/DebugMemLeakFinder.cpp	2006-10-11 21:58:41 UTC (rev 971)
+++ box/chris/general/lib/common/DebugMemLeakFinder.cpp	2006-10-11 21:59:20 UTC (rev 972)
@@ -183,7 +183,9 @@
 	}
 	else
 	{
-		sNotLeaksPre[sNotLeaksPreNum++] = ptr;
+		if ( sNotLeaksPreNum < 
+			 (unsigned)( sizeof(sNotLeaksPre)/sizeof(*sNotLeaksPre) ) )
+			sNotLeaksPre[sNotLeaksPreNum++] = ptr;
 	}
 /*	{
 		std::map<void *, MallocBlockInfo>::iterator i(sMallocBlocks.find(ptr));




More information about the Boxbackup-commit mailing list