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