From b304ec7b5a937fbfc89085a7a609e4b67b0e2911 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 30 Oct 2019 15:02:49 +1300 Subject: [PATCH] ndr_orpc: properly allocate empty DUALSTRINGARRAY When there is no data we still need to allocate for the terminating NULL. Signed-off-by: Douglas Bagnall --- librpc/ndr/ndr_orpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git librpc/ndr/ndr_orpc.c librpc/ndr/ndr_orpc.c index f24ddc5f826..01ba885d942 100644 --- librpc/ndr/ndr_orpc.c +++ librpc/ndr/ndr_orpc.c @@ -37,7 +37,7 @@ enum ndr_err_code ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &security_offset)); - ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries); + ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1); ar->stringbindings[0] = NULL; do { @@ -56,7 +56,7 @@ enum ndr_err_code ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, ar->stringbindings[towernum] = NULL; towernum = 0; - ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries); + ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, 1); ar->securitybindings[0] = NULL; do { -- 2.20.1