From 79cc502e5d065a9a700f46d004873b0a6fac1130 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 5 Sep 2008 20:18:07 +0200 Subject: [PATCH] ndr_compression: use inflateReset() and inflateSetDictionary() instead of inflateReset2() Now we can use an unmodified system zlib-1.2.3 metze (This used to be commit d68e36b485239cbaf99a6dce3f3bf52b4abcd06d) --- source4/librpc/ndr/ndr_compression.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source4/librpc/ndr/ndr_compression.c b/source4/librpc/ndr/ndr_compression.c index 37f95bb1b606..0b33d40c2429 100644 --- a/source4/librpc/ndr/ndr_compression.c +++ b/source4/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; } -- 2.34.1