Be sure to pass iconv handle down to compression subcontexts (fixes
authorAndrew Bartlett <abartlet@samba.org>
Mon, 21 Jan 2008 09:56:27 +0000 (20:56 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 21 Jan 2008 09:56:27 +0000 (20:56 +1100)
segfaults in NET-API-BECOME-DC)

Andrew Bartlett
(This used to be commit 70c1e918e6bd01946425e2d89cb680f14152f9fc)

source4/librpc/ndr/ndr_compression.c

index 310f8c4ce44dfa487535c0bafc96aa76f03701fb..86a5a2560ef2ba400309dbd151d2710475989f1c 100644 (file)
@@ -112,6 +112,8 @@ static enum ndr_err_code ndr_pull_compression_mszip(struct ndr_pull *subndr,
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
+       comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
+
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[0]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[1]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[2]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[0]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[1]));
        NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[2]));
@@ -215,6 +217,8 @@ static enum ndr_err_code ndr_pull_compression_xpress(struct ndr_pull *subndr,
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
        comndr->data_size       = uncompressed.length;
        comndr->offset          = 0;
 
+       comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
+
        *_comndr = comndr;
        return NDR_ERR_SUCCESS;
 }
        *_comndr = comndr;
        return NDR_ERR_SUCCESS;
 }