]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/dl-addr.c
Fix bad pointer / leak in regex code
[thirdparty/glibc.git] / elf / dl-addr.c
index 2250617a730994730b3d166012d334bef48dc1db..9d285d76a728a1c378d9f202e31bdc816e16f665 100644 (file)
@@ -1,5 +1,5 @@
 /* Locate the shared object symbol nearest a given address.
-   Copyright (C) 1996-2018 Free Software Foundation, Inc.
+   Copyright (C) 1996-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -59,6 +59,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
                     we can omit that test here.  */
                  if ((symtab[symndx].st_shndx != SHN_UNDEF
                       || symtab[symndx].st_value != 0)
+                     && symtab[symndx].st_shndx != SHN_ABS
                      && ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
                      && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
                                            matchsym, addr)
@@ -91,6 +92,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
            && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
            && (symtab->st_shndx != SHN_UNDEF
                || symtab->st_value != 0)
+           && symtab->st_shndx != SHN_ABS
            && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
            && symtab->st_name < strtabsize)
          matchsym = (ElfW(Sym) *) symtab;