]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/cache.c
Fix bad pointer / leak in regex code
[thirdparty/glibc.git] / elf / cache.c
index b8934898b6ddb17b6a2667ab5468086a2165391e..d0d5858448516d4f4ed793c8fc66041439d72073 100644 (file)
@@ -211,8 +211,8 @@ print_cache (const char *cache_name)
       cache_data = (const char *) &cache->libs[cache->nlibs];
 
       /* Check for a new cache embedded in the old format.  */
-      if (cache_size >
-         (offset + sizeof (struct cache_file_new)))
+      if (cache_size
+         (offset + sizeof (struct cache_file_new)))
        {
 
          cache_new = (struct cache_file_new *) ((void *)cache + offset);
@@ -712,8 +712,8 @@ load_aux_cache (const char *aux_cache_name)
   if (aux_cache == MAP_FAILED
       || aux_cache_size < sizeof (struct aux_cache_file)
       || memcmp (aux_cache->magic, AUX_CACHEMAGIC, sizeof AUX_CACHEMAGIC - 1)
-      || aux_cache_size != (sizeof(struct aux_cache_file)
-                           + aux_cache->nlibs * sizeof(struct aux_cache_file_entry)
+      || aux_cache_size != (sizeof (struct aux_cache_file)
+                           + aux_cache->nlibs * sizeof (struct aux_cache_file_entry)
                            + aux_cache->len_strings))
     {
       close (fd);