[PATCH 2/2] param: avoid dereferencing null lp_ctx
David Disseldorp
ddiss at samba.org
Mon Aug 11 09:57:18 MDT 2014
process_smbconf_service() calls lp_do_section() with a NULL userdata
(struct loadparm_context *) argument. Since 0864d4945, lp_do_section()
unconditionally attempts to set the lp_ctx->bInGlobalSection variable,
resulting in a segfault.
Signed-off-by: David Disseldorp <ddiss at samba.org>
---
source3/param/loadparm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index c428c23..94d3b8d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2584,7 +2584,9 @@ bool lp_do_section(const char *pszSectionName, void *userdata)
/* if we've just struck a global section, note the fact. */
bInGlobalSection = isglobal;
- lp_ctx->bInGlobalSection = isglobal;
+ if (lp_ctx != NULL) {
+ lp_ctx->bInGlobalSection = isglobal;
+ }
/* check for multiple global sections */
if (bInGlobalSection) {
--
1.8.4.5
More information about the samba-technical
mailing list