about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorXiaoming Ni <nixiaoming@huawei.com>2022-11-04 17:30:00 +0800
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-07 13:13:07 +0000
commitd1d0162e50afe7fa1e2fc4a901eb411db48acd7b (patch)
treebe6e95205cb9bd7311935a8c8605c40bf625b16c /elf
parent9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e (diff)
downloadglibc-d1d0162e50afe7fa1e2fc4a901eb411db48acd7b.tar.gz
glibc-d1d0162e50afe7fa1e2fc4a901eb411db48acd7b.tar.xz
glibc-d1d0162e50afe7fa1e2fc4a901eb411db48acd7b.zip
elf/tlsdeschtab.h: Add the Malloc return value check in _dl_make_tlsdesc_dynamic()
Check the return value of malloc based on the function header comment of
 _dl_make_tlsdesc_dynamic(). If the return value fails, NULL is returned.

Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Diffstat (limited to 'elf')
-rw-r--r--elf/tlsdeschtab.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/elf/tlsdeschtab.h b/elf/tlsdeschtab.h
index 8c02e45a49..82733159e3 100644
--- a/elf/tlsdeschtab.h
+++ b/elf/tlsdeschtab.h
@@ -110,6 +110,8 @@ _dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset)
     }
 
   *entry = td = malloc (sizeof (struct tlsdesc_dynamic_arg));
+  if (! td)
+    return 0;
   /* This may be higher than the map's generation, but it doesn't
      matter much.  Worst case, we'll have one extra DTV update per
      thread.  */