From: Stefan Metzmacher Date: Fri, 22 May 2026 15:32:30 +0000 (+0000) Subject: s4:torture: let test_ndr_push_string() use strncmp() as strings might not be terminated X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29cf4ee46be849ae880a77d77cc9c2116fd970b8;p=thirdparty%2Fsamba.git s4:torture: let test_ndr_push_string() use strncmp() as strings might not be terminated Otherwise this is not reliable. BUG: https://bugzilla.samba.org/show_bug.cgi?id=16006 Signed-off-by: Stefan Metzmacher Reviewed-by: Martin Schwenke --- diff --git a/source4/torture/ndr/string.c b/source4/torture/ndr/string.c index 16d3fc37967..3b891c087cf 100644 --- a/source4/torture/ndr/string.c +++ b/source4/torture/ndr/string.c @@ -63,7 +63,7 @@ test_ndr_push_string (struct torture_context *tctx, const char *string, "ndr_push_string: succeeded but NULL data"); torture_assert(tctx, - strcmp_pass == !strcmp(string, (char *)ndr->data), + strcmp_pass == !strncmp(string, (char *)ndr->data, expected_offset), "ndr_push_string: post-push strcmp"); }