8ae002
commit 6a1cf708dd5681b517744d6d4fac02e4e4a0aa2e
8ae002
Author: Aurelien Jarno <aurelien@aurel32.net>
8ae002
Date:   Wed Mar 11 21:03:50 2015 -0400
8ae002
8ae002
    Fix ldconfig segmentation fault with corrupted cache (Bug 18093).
8ae002
8ae002
--- glibc-2.17-c758a686/elf/cache.c
8ae002
+++ glibc-2.17-c758a686/elf/cache.c
8ae002
@@ -688,7 +688,9 @@
8ae002
   if (aux_cache == MAP_FAILED
8ae002
       || aux_cache_size < sizeof (struct aux_cache_file)
8ae002
       || memcmp (aux_cache->magic, AUX_CACHEMAGIC, sizeof AUX_CACHEMAGIC - 1)
8ae002
-      || aux_cache->nlibs >= aux_cache_size)
8ae002
+      || aux_cache_size != (sizeof(struct aux_cache_file) +
8ae002
+                            aux_cache->nlibs * sizeof(struct aux_cache_file_entry) +
8ae002
+                            aux_cache->len_strings))
8ae002
     {
8ae002
       close (fd);
8ae002
       init_aux_cache ();