From: Volker Lendecke Date: Sun, 29 Sep 2024 06:13:04 +0000 (+0200) Subject: lib: Fix CID 1620428: Memory - illegal accesses (OVERRUN) X-Git-Tag: tdb-1.4.13~1037 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f749330ddaba04cdae20570a9e842327715f3594;p=thirdparty%2Fsamba.git lib: Fix CID 1620428: Memory - illegal accesses (OVERRUN) Beginner's mistake, sorry. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Sep 29 11:49:13 UTC 2024 on atb-devel-224 --- diff --git a/libcli/smb/util.c b/libcli/smb/util.c index a864a1078cd..473b479a2ab 100644 --- a/libcli/smb/util.c +++ b/libcli/smb/util.c @@ -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];