summaryrefslogtreecommitdiff
path: root/lib/smbconf
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-09-27 12:43:39 +0200
committerMichael Adam <obnox@samba.org>2010-09-27 12:43:39 +0200
commit84127dd50420a7d0e8f389d4af15d52fca6cd809 (patch)
tree27f55836d72f87e496f1184c3ae942b21e8d3d87 /lib/smbconf
parentf4f5ad97741d4c6be32573338baa346808e1f108 (diff)
downloadsamba-84127dd50420a7d0e8f389d4af15d52fca6cd809.tar.gz
samba-84127dd50420a7d0e8f389d4af15d52fca6cd809.tar.bz2
samba-84127dd50420a7d0e8f389d4af15d52fca6cd809.zip
libsmbconf: parse an empty share as empty share, not as NULL.
This fixes a segfault in net conf import: Importing a text file with an empty share resulted in a segfault. Now this creates an empty share in registry config, just as it should. Thanks to Gregor Beck <gbeck@sernet.de> for reporting.
Diffstat (limited to 'lib/smbconf')
-rw-r--r--lib/smbconf/smbconf_txt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c
index 37b01df3d3..2114841b81 100644
--- a/lib/smbconf/smbconf_txt.c
+++ b/lib/smbconf/smbconf_txt.c
@@ -453,11 +453,7 @@ static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx,
}
tmp_service->num_params = count;
- if (count > 0) {
- *service = talloc_move(mem_ctx, &tmp_service);
- } else {
- *service = NULL;
- }
+ *service = talloc_move(mem_ctx, &tmp_service);
done:
talloc_free(tmp_ctx);