]> git.ipfire.org Git - thirdparty/samba.git/commit
s3:loadparm: fix NULL pointer dereference in volume_label() master
authorJeremy Allison <jallison@ciq.com>
Fri, 10 Apr 2026 21:24:34 +0000 (14:24 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 15 Apr 2026 00:07:12 +0000 (00:07 +0000)
commit14bc301ed512369c0053b3301faa374f7ea38d08
tree9df3ff1dfd1de646666d972b5c93e12f7a47b76f
parent30c84623be07733f1728424e84525459e64920ce
s3:loadparm: fix NULL pointer dereference in volume_label()

volume_label() calls lp_servicename() as a fallback when lp_volume()
returns an empty string. lp_servicename() is a FN_LOCAL_SUBSTITUTED_STRING
that falls back to sDefault.szService when the service is invalid. Since
sDefault.szService is initialized to NULL and is never set by
init_globals(), the substitution returns NULL, and the subsequent
strlen() call crashes with a segmentation fault.

Add a NULL guard so volume_label() returns an empty string instead
of crashing.

Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14978

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 15 00:07:12 UTC 2026 on atb-devel-224
selftest/knownfail
source3/param/loadparm.c