]> git.ipfire.org Git - thirdparty/samba.git/commit
s3:utils: Fix buffer underflow in parse_timeout for empty strings master
authorshumikhinaka <shumikhinaka@sgu.ru>
Thu, 11 Jun 2026 14:49:58 +0000 (18:49 +0400)
committerAnoop C S <anoopcs@samba.org>
Fri, 19 Jun 2026 13:03:44 +0000 (13:03 +0000)
commitccf67b37f83e18465ac51e4f71b88d10f537dd21
tree528a14063d5f4a808e2aee646a667b029eb23a71
parent34ebd366eb185f3674b191808686dbcfbb2ebee9
s3:utils: Fix buffer underflow in parse_timeout for empty strings

The parse_timeout function is called with a command-line argument. The user
may pass an empty string, which will result in undefined behavior until
the result is checked.

A check for the string length has been added immediately after the strlen()
call. If an empty string is passed, the function returns 0, preventing
incorrect access to the array.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Shumikhina Ksenia <shumikhinaka@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 19 13:03:44 UTC 2026 on atb-devel-224
source3/utils/net_cache.c