summaryrefslogtreecommitdiff
path: root/source3/lib/substitute.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-06-18 14:50:53 +0200
committerMichael Adam <obnox@samba.org>2008-06-18 14:50:53 +0200
commit1917b388734217426ecf14fb041f97060873c8fa (patch)
tree63156d98dec92417f626617ca1c688cf9fe5adbf /source3/lib/substitute.c
parentaedce263a81a2ff167f25fa7ac865ac858a5cb90 (diff)
downloadsamba-1917b388734217426ecf14fb041f97060873c8fa.tar.gz
samba-1917b388734217426ecf14fb041f97060873c8fa.tar.bz2
samba-1917b388734217426ecf14fb041f97060873c8fa.zip
Fix Bug #5548 (segfauls in handle_include with %m macro expansion).
In alloc_sub_basic, when expanding '%m', substitute "" instead of NULL for remote_machine when this is NULL. Else a NULL string is returned. Michael (This used to be commit c65b456c6a145d15b7fd27a2a3440a0709fc3277)
Diffstat (limited to 'source3/lib/substitute.c')
-rw-r--r--source3/lib/substitute.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 17bcbcac9d..926bb8233d 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -655,7 +655,10 @@ char *alloc_sub_basic(const char *smb_name, const char *domain_name,
a_string = realloc_string_sub(a_string, "%h", myhostname());
break;
case 'm' :
- a_string = realloc_string_sub(a_string, "%m", remote_machine);
+ a_string = realloc_string_sub(a_string, "%m",
+ remote_machine
+ ? remote_machine
+ : "");
break;
case 'v' :
a_string = realloc_string_sub(a_string, "%v", SAMBA_VERSION_STRING);