From: Douglas Bagnall Date: Thu, 26 Oct 2023 04:28:44 +0000 (+1300) Subject: libcli/security: sddl: guard against inconsistent msg pointers X-Git-Tag: talloc-2.4.2~902 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c31d41d72199937f5902c3e32b88c4743522ef26;p=thirdparty%2Fsamba.git libcli/security: sddl: guard against inconsistent msg pointers Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c index a0457e1605d..15943e6aa24 100644 --- a/libcli/security/sddl.c +++ b/libcli/security/sddl.c @@ -839,6 +839,15 @@ struct security_descriptor *sddl_decode_err_msg(TALLOC_CTX *mem_ctx, const char sd->revision = SECURITY_DESCRIPTOR_REVISION_1; sd->type = SEC_DESC_SELF_RELATIVE; + if (msg != NULL) { + if (msg_offset == NULL) { + DBG_ERR("Programmer misbehaviour\n"); + goto failed; + } + *msg = NULL; + *msg_offset = 0; + } + while (*sddl) { uint32_t flags; char c = sddl[0];