diff options
| author | David Disseldorp <ddiss@samba.org> | 2014-08-11 17:51:58 +0200 |
|---|---|---|
| committer | David Disseldorp <ddiss@samba.org> | 2014-08-11 21:00:15 +0200 |
| commit | b19283c0f4cd8e54ff1eef9522fdb420136f5291 (patch) | |
| tree | 5257f0f40b8476b063e12226a8a0f2d3f54385ae /source3 | |
| parent | 9d5fba18ab77c589013e399810bccdc465b6f708 (diff) | |
| download | samba-b19283c0f4cd8e54ff1eef9522fdb420136f5291.tar.gz samba-b19283c0f4cd8e54ff1eef9522fdb420136f5291.tar.xz samba-b19283c0f4cd8e54ff1eef9522fdb420136f5291.zip | |
param: avoid dereferencing null lp_ctx
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Aug 11 21:00:15 CEST 2014 on sn-devel-104
Diffstat (limited to 'source3')
| -rw-r--r-- | source3/param/loadparm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c428c23601..94d3b8de57 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) { |
