[Lsb-messages] /var/www/bzr/lsb/devel/misc-test r2411: quiet nullptr deref (bug 3868)

Mats Wichmann mats at linuxfoundation.org
Tue Dec 17 15:40:54 UTC 2013


------------------------------------------------------------
revno: 2411
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: misc-test
timestamp: Tue 2013-12-17 08:40:54 -0700
message:
  quiet nullptr deref (bug 3868)
modified:
  elfchk/dwarf.c
-------------- next part --------------
=== modified file 'elfchk/dwarf.c'
--- a/elfchk/dwarf.c	2013-01-25 14:28:29 +0000
+++ b/elfchk/dwarf.c	2013-12-17 15:40:54 +0000
@@ -620,8 +620,13 @@
 	fprintf(stderr, "\n");
     }
 
-    while (ptr < endptr)
-	ptr += check_CFI(ptr, error, cie->fde_encoding);
+    if (cie) {
+	/* Not sure if ptr can be less than endptr if cie is NULL,
+	   but let's add a check for sure (and to calm down checkers
+	   claiming about possible NULL dereference) */
+	while (ptr < endptr)
+	    ptr += check_CFI(ptr, error, cie->fde_encoding);
+    }
 
     return fdeimage.length + 4;	/* length+sizeof(length) */
 }



More information about the lsb-messages mailing list