s4:torture: handle binding_struct->host == NULL in torture_parse_target()
authorStefan Metzmacher <metze@samba.org>
Sun, 26 Jan 2014 00:55:52 +0000 (01:55 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 11 Feb 2014 15:20:31 +0000 (16:20 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/smbtorture.c

index cb0be97cafab56ce82cedc106549813b6ed2a4f9..fd5315d20ce2e2070b30d6395008e41f4a75fdfa 100644 (file)
@@ -163,7 +163,9 @@ bool torture_parse_target(struct loadparm_context *lp_ctx, const char *target)
                        d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", target);
                        return false;
                }
-               lpcfg_set_cmdline(lp_ctx, "torture:host", binding_struct->host);
+               if (binding_struct->host != NULL) {
+                       lpcfg_set_cmdline(lp_ctx, "torture:host", binding_struct->host);
+               }
                if (lpcfg_parm_string(lp_ctx, NULL, "torture", "share") == NULL)
                        lpcfg_set_cmdline(lp_ctx, "torture:share", "IPC$");
                lpcfg_set_cmdline(lp_ctx, "torture:binding", target);