1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

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 commit is contained in:
Michael Adam
2008-06-18 14:50:53 +02:00
parent 7d5fb873bd
commit c65b456c6a

View File

@ -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);