From: Andreas Schneider Date: Tue, 9 Sep 2025 07:24:47 +0000 (+0200) Subject: s4:torture: Fix stack buffer overflow in test_dirlease_oplocks() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5c238a879182a2dfe528ae49f97da75e242afe7;p=thirdparty%2Fsamba.git 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 --- 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,