|
From: <sv...@va...> - 2010-07-22 22:36:55
|
Author: sewardj
Date: 2010-07-22 23:36:43 +0100 (Thu, 22 Jul 2010)
New Revision: 11226
Log:
pdb_ds_read: if the presented size is implausibly huge (> 512MB),
ignore it on the assumption that the .pdb is corrupt, rather than
running the system out of memory by trying to allocate a chunk of that
size.
Modified:
trunk/coregrind/m_debuginfo/readpdb.c
Modified: trunk/coregrind/m_debuginfo/readpdb.c
===================================================================
--- trunk/coregrind/m_debuginfo/readpdb.c 2010-07-22 11:39:28 UTC (rev 11225)
+++ trunk/coregrind/m_debuginfo/readpdb.c 2010-07-22 22:36:43 UTC (rev 11226)
@@ -997,6 +997,11 @@
UInt i;
if (!size) return NULL;
+ if (size > 512 * 1024 * 1024) {
+ VG_(umsg)("Warning: pdb_ds_read: implausible size "
+ "(%u); skipping -- possible invalid .pdb file?\n", size);
+ return NULL;
+ }
blocksize = pdb->u.ds.header->block_size;
nBlocks = (size + blocksize - 1) / blocksize;
|