Patch for dl-cache.c
Andreas Jaeger
aj@suse.de
Wed Nov 24 06:51:00 GMT 1999
Jakub found a bug in my version of ldconfig, which is also in glibc's
dl-cache. I'm appending a patch for dl-cache.c.
The bug is that the final NUL in CACHEMAGIC is part of the magic - but
the data structure doesn't reserve space for it (this worked due to
alignment).
Andreas
1999-11-24 Andreas Jaeger <aj@suse.de>
* sysdeps/generic/dl-cache.c: The final NUL is part of magic, add
it to structure and check for it.
============================================================
Index: sysdeps/generic/dl-cache.c
--- sysdeps/generic/dl-cache.c 1999/06/09 11:41:57 1.19
+++ sysdeps/generic/dl-cache.c 1999/11/24 14:38:11
@@ -36,7 +36,7 @@
struct cache_file
{
- char magic[sizeof CACHEMAGIC - 1];
+ char magic[sizeof CACHEMAGIC];
unsigned int nlibs;
struct
{
@@ -118,7 +118,7 @@
void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
PROT_READ);
if (file && cachesize > sizeof *cache &&
- !memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1))
+ !memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC))
/* Looks ok. */
cache = file;
else
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de
More information about the Libc-hacker
mailing list