From: Stefan Metzmacher Date: Fri, 5 Sep 2008 18:18:07 +0000 (+0200) Subject: ndr_compression: use inflateReset() and inflateSetDictionary() instead of inflateReset2() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d68e36b485239cbaf99a6dce3f3bf52b4abcd06d;p=thirdparty%2Fsamba.git ndr_compression: use inflateReset() and inflateSetDictionary() instead of inflateReset2() Now we can use an unmodified system zlib-1.2.3 metze --- diff --git a/source/librpc/ndr/ndr_compression.c b/source/librpc/ndr/ndr_compression.c index 37f95bb1b60..0b33d40c242 100644 --- a/source/librpc/ndr/ndr_compression.c +++ b/source/librpc/ndr/ndr_compression.c @@ -104,13 +104,6 @@ static enum ndr_err_code ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpu zError(z_ret), z_ret); } - } else { - z_ret = inflateReset2(z, Z_RESET_KEEP_WINDOW); - if (z_ret != Z_OK) { - return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, - "Bad inflateReset2 error %s(%d) (PULL)", - zError(z_ret), z_ret); - } } /* call inflate untill we get Z_STREAM_END or an error */ @@ -142,6 +135,20 @@ static enum ndr_err_code ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpu *last = true; } + z_ret = inflateReset(z); + if (z_ret != Z_OK) { + return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, + "Bad inflateReset error %s(%d) (PULL)", + zError(z_ret), z_ret); + } + + z_ret = inflateSetDictionary(z, plain_chunk.data, plain_chunk.length); + if (z_ret != Z_OK) { + return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, + "Bad inflateSetDictionary error %s(%d) (PULL)", + zError(z_ret), z_ret); + } + return NDR_ERR_SUCCESS; }