This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] elf/cache.c: Fix incorrect condition
- From: Marek Polacek <mpolacek at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 15 Jul 2011 13:30:45 +0200
- Subject: [PATCH] elf/cache.c: Fix incorrect condition
In `load_aux_cache' we check if aux_cache->nlibs < 0, but since
`nlibs' is of type uint32_t, this is never the case. So we may
omit this condition.
2011-07-15 Marek Polacek <mpolacek@redhat.com>
* elf/cache.c (load_aux_cache): Remove incorrect condition of
"aux_cache->nlibs < 0".
--- libc/elf/cache.c.mp 2011-07-15 11:21:22.586796760 +0200
+++ libc/elf/cache.c 2011-07-15 13:20:02.784797957 +0200
@@ -675,7 +675,6 @@ load_aux_cache (const char *aux_cache_na
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->nlibs < 0
|| aux_cache->nlibs >= aux_cache_size)
{
close (fd);