]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(elf_dynamic_do_rel): Avoid overflow in computation to skip relative
authorUlrich Drepper <drepper@redhat.com>
Sat, 29 Jun 2002 17:00:24 +0000 (17:00 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 29 Jun 2002 17:00:24 +0000 (17:00 +0000)
relocations.

elf/do-rel.h

index 8b9bdf2da75c2c43ceb26352ed0821177df552f2..42df96945bd4e354fe319adde8aa2bb974bcca2c 100644 (file)
@@ -66,7 +66,7 @@ elf_dynamic_do_rel (struct link_map *map,
       ElfW(Word) nrelative = (map->l_info[RELCOUNT_IDX] == NULL
                              ? 0 : map->l_info[RELCOUNT_IDX]->d_un.d_val);
       const ElfW(Rel) *relative = r;
-      r = MIN (r + nrelative, end);
+      r = r + MIN (nrelative, relsize / sizeof (ElfW(Rel)));
 
 #ifndef RTLD_BOOTSTRAP
       /* This is defined in rtld.c, but nowhere in the static libc.a; make