]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf: Make sure n * w doesn't overflow in elf_getarsym.
authorMark Wielaard <mjw@redhat.com>
Tue, 9 Dec 2014 12:43:58 +0000 (13:43 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 12 Dec 2014 12:04:19 +0000 (13:04 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf_getarsym.c

index e03ee09f2867008c7ac9818104e87f2fcda02f43..4860530b85a8b6013e1991e4b3263b3ce3730934 100644 (file)
@@ -1,3 +1,7 @@
+2014-12-09  Mark Wielaard  <mjw@redhat.com>
+
+       * elf_getarsym.c (elf_getarsym): Make sure n * w doesn't overflow.
+
 2014-11-27  Mark Wielaard  <mjw@redhat.com>
 
        * Makefile.am (libelf.so): Use textrel_check.
index 7325190ab243f40eaa40bdf0475c1d1a0ba4c8e9..ba88aa0aa74c255e8a32e7717686e9b864622779 100644 (file)
@@ -186,7 +186,7 @@ elf_getarsym (elf, ptr)
 #if SIZE_MAX <= 4294967295U
          || n >= SIZE_MAX / sizeof (Elf_Arsym)
 #endif
-         || n * w > index_size)
+         || n > index_size / w)
        {
          /* This index table cannot be right since it does not fit into
             the file.  */