Witold Baryluk wrote:

> why suppressing this error, it is probably real problem
> in libz.

What makes you say that?  The zlib FAQ says:

| 36. Valgrind (or some similar memory access checker) says that deflate is
|     performing a conditional jump that depends on an uninitialized value.
|     Isn't that a bug?
|
|     No.  That is intentional for performance reasons, and the output of
|     deflate is not affected.  This only started showing up recently since
|     zlib 1.2.x uses malloc() by default for allocations, whereas earlier
|     versions used calloc(), which zeros out the allocated memory.

zlib 1.2.3.7 eliminated the access of unitialized memory you mention,
using the following patch:

| diff --git a/inflate.c b/inflate.c
| index 40c0ec8b..a8431abe 100644
| --- a/inflate.c
| +++ b/inflate.c
| @@ -1,5 +1,5 @@
|  /* inflate.c -- zlib decompression
| - * Copyright (C) 1995-2009 Mark Adler
| + * Copyright (C) 1995-2010 Mark Adler
|   * For conditions of distribution and use, see copyright notice in zlib.h
|   */
|  
| @@ -154,7 +154,7 @@ int windowBits;
|      /* set number of window bits, free window if different */
|      if (windowBits && (windowBits < 8 || windowBits > 15))
|          return Z_STREAM_ERROR;
| -    if (state->wbits != (unsigned)windowBits && state->window != Z_NULL) {
| +    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
|          ZFREE(strm, state->window);
|          state->window = Z_NULL;
|      }

As you can see, the output is not affected.



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to