]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Fix stack buffer overflow in test_dirlease_oplocks()
authorAndreas Schneider <asn@samba.org>
Tue, 9 Sep 2025 07:24:47 +0000 (09:24 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 9 Sep 2025 09:27:33 +0000 (09:27 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15907

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  9 09:27:33 UTC 2025 on atb-devel-224

source4/torture/smb2/lease.c

index de6c2dd69add8ef8c670934570b3afe61fc02fdd..9696ddc11daac9daf8de36bd2e204dfdb29597b7 100644 (file)
@@ -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,