1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ndr: skip talloc when pulling empty DATA_BLOB

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574
(cherry picked from commit c2673b02a7)
This commit is contained in:
Douglas Bagnall 2023-12-29 15:15:48 +13:00 committed by Jule Anger
parent e61d447690
commit 5d0d17a92d

View File

@ -1453,6 +1453,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, ndr_flags_ty
} else {
NDR_CHECK(ndr_pull_uint3264(ndr, NDR_SCALARS, &length));
}
if (length == 0) {
/* skip the talloc for an empty blob */
blob->data = NULL;
blob->length = 0;
return NDR_ERR_SUCCESS;
}
NDR_PULL_NEED_BYTES(ndr, length);
*blob = data_blob_talloc(ndr->current_mem_ctx, ndr->data+ndr->offset, length);
ndr->offset += length;