From c5c238a879182a2dfe528ae49f97da75e242afe7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 9 Sep 2025 09:24:47 +0200 Subject: [PATCH] s4:torture: Fix stack buffer overflow in test_dirlease_oplocks() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15907 Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Sep 9 09:27:33 UTC 2025 on atb-devel-224 --- source4/torture/smb2/lease.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/smb2/lease.c b/source4/torture/smb2/lease.c index de6c2dd69ad..9696ddc11da 100644 --- a/source4/torture/smb2/lease.c +++ b/source4/torture/smb2/lease.c @@ -1516,7 +1516,7 @@ static bool test_dirlease_oplocks(struct torture_context *tctx, smb2_deltree(tree, dname); - for (i = 0; i < sizeof(levels); i++) { + for (i = 0; i < ARRAY_SIZE(levels); i++) { c = (struct smb2_create) { .in.oplock_level = levels[i], .in.desired_access = SEC_RIGHTS_DIR_READ, -- 2.47.3