[Box Backup-commit] COMMIT r1088 - box/chris/merge/lib/common
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Tue Oct 17 00:22:17 BST 2006
Author: chris
Date: 2006-10-17 00:22:17 +0100 (Tue, 17 Oct 2006)
New Revision: 1088
Modified:
box/chris/merge/lib/common/DebugMemLeakFinder.cpp
Log:
Fix memory corruption when the number of not-leaks exceeds the table size.
(refs #3)
Modified: box/chris/merge/lib/common/DebugMemLeakFinder.cpp
===================================================================
--- box/chris/merge/lib/common/DebugMemLeakFinder.cpp 2006-10-16 23:21:36 UTC (rev 1087)
+++ box/chris/merge/lib/common/DebugMemLeakFinder.cpp 2006-10-16 23:22:17 UTC (rev 1088)
@@ -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