]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Fix CID 1620428: Memory - illegal accesses (OVERRUN)
authorVolker Lendecke <vl@samba.org>
Sun, 29 Sep 2024 06:13:04 +0000 (08:13 +0200)
committerMartin Schwenke <martins@samba.org>
Sun, 29 Sep 2024 11:49:13 +0000 (11:49 +0000)
Beginner's mistake, sorry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Sep 29 11:49:13 UTC 2024 on atb-devel-224

libcli/smb/util.c

index a864a1078cd6e4d448fdefff651a097a5333e028..473b479a2abf60cb28ee4374b5d90cb6dda82213 100644 (file)
@@ -176,7 +176,7 @@ static mode_t unix_filetypes[] =
 
 mode_t wire_filetype_to_unix(uint32_t wire_type)
 {
-       if (wire_type > ARRAY_SIZE(unix_filetypes)) {
+       if (wire_type >= ARRAY_SIZE(unix_filetypes)) {
                return (mode_t)0;
        }
        return unix_filetypes[wire_type];