]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
parse_procselfmaps: don't hand zero-length mappings to
authorJulian Seward <jseward@acm.org>
Sun, 7 Jan 2007 01:49:31 +0000 (01:49 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 7 Jan 2007 01:49:31 +0000 (01:49 +0000)
*record_mapping, since they can't really be represented by the segment
table herein, and are mistaken for a mapping which covers the entire
address space.  Intended to fix #132998, but fix has not been
verified.  It does not appear to cause any other failures though.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH@6480

coregrind/m_aspacemgr/aspacemgr.c

index 4c555ba7d25de6b87be2e1ca84703f59d7e0a2de..9e42f39f72f3902b5457c9977a99d9419865e078 100644 (file)
@@ -3412,9 +3412,10 @@ static void parse_procselfmaps (
       if (record_gap && gapStart < start)
          (*record_gap) ( gapStart, start-gapStart );
 
-      (*record_mapping) ( start, endPlusOne-start, 
-                          prot, dev, ino,
-                          foffset, filename );
+      if (record_mapping && start < endPlusOne)
+         (*record_mapping) ( start, endPlusOne-start, 
+                             prot, dev, ino,
+                             foffset, filename );
 
       if ('\0' != tmp) {
          filename[i_eol - i] = tmp;