summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-11-13 12:37:41 +0000
committerMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-11-13 12:37:41 +0000
commita615be46758fd857872e3e2a12f1fd296bee1a7c (patch)
tree416953fedd5aef27f30c18c887d2cf85a6ef9f19
parent7ddace62b0ea4c733fec0a50b52dbdef64f40c9c (diff)
downloadglibc-a615be46758fd857872e3e2a12f1fd296bee1a7c.tar.gz
glibc-a615be46758fd857872e3e2a12f1fd296bee1a7c.tar.xz
glibc-a615be46758fd857872e3e2a12f1fd296bee1a7c.zip
Handle NULL return from htab_find_slot()
-rw-r--r--ChangeLog5
-rw-r--r--elf/tlsdeschtab.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ac141b8422..b129b320b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-13  Marcus Shawcroft  <marcus.shawcroft@linaro.org>
+
+	* elf/tlsdeschtab.h (_dl_make_tlsdesc_dynamic): Handle failure
+	of htab_find_slot().
+
 2013-11-11  David S. Miller  <davem@davemloft.net>
 
 	[BZ #16150]
diff --git a/elf/tlsdeschtab.h b/elf/tlsdeschtab.h
index 155f4fdd9b..8ce8249b92 100644
--- a/elf/tlsdeschtab.h
+++ b/elf/tlsdeschtab.h
@@ -102,6 +102,12 @@ _dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset)
   test.tlsinfo.ti_module = map->l_tls_modid;
   test.tlsinfo.ti_offset = ti_offset;
   entry = htab_find_slot (ht, &test, 1, hash_tlsdesc, eq_tlsdesc);
+  if (! entry)
+    {
+      __rtld_lock_unlock_recursive (GL(dl_load_lock));
+      return 0;
+    }
+
   if (*entry)
     {
       td = *entry;