From: Joseph Sutton Date: Wed, 2 Aug 2023 02:15:09 +0000 (+1200) Subject: libcli/security: Emit error message if program is too large X-Git-Tag: tevent-0.16.0~391 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cb3beee75c5290022f1955d287a2353cfb7732e;p=thirdparty%2Fsamba.git libcli/security: Emit error message if program is too large Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/libcli/security/conditional_ace.c b/libcli/security/conditional_ace.c index b970e2fe0b4..50935a20a53 100644 --- a/libcli/security/conditional_ace.c +++ b/libcli/security/conditional_ace.c @@ -2055,6 +2055,7 @@ bool conditional_ace_encode_binary(TALLOC_CTX *mem_ctx, data[j] = tok->type; j++; if (j >= alloc_size) { + DBG_ERR("program exceeds %zu bytes\n", alloc_size); goto error; } @@ -2132,16 +2133,19 @@ bool conditional_ace_encode_binary(TALLOC_CTX *mem_ctx, goto error; } if (consumed == -1) { + DBG_ERR("program exceeds %zu bytes\n", alloc_size); goto error; } j += consumed; if (j >= alloc_size) { + DBG_ERR("program exceeds %zu bytes\n", alloc_size); goto error; } } /* align to a 4 byte boundary */ required_size = (j + 3) & ~((size_t)3); if (required_size > alloc_size) { + DBG_ERR("program exceeds %zu bytes\n", alloc_size); goto error; } while (j < required_size) {