s4/torture: let write_stream() deal with stream=NULL
authorRalph Boehme <slow@samba.org>
Fri, 17 Nov 2017 07:13:10 +0000 (08:13 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 29 Nov 2017 03:35:24 +0000 (04:35 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13155

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/vfs/fruit.c

index 3c3810ceaa6dfa2f9a683cebb3ee99c905cf4ab5..471a755a40d3f75f7509224be869c3060812aacf 100644 (file)
@@ -1140,7 +1140,7 @@ static bool write_stream(struct smb2_tree *tree,
        NTSTATUS status;
        const char *full_name;
 
-       full_name = talloc_asprintf(mem_ctx, "%s%s", fname, sname);
+       full_name = talloc_asprintf(mem_ctx, "%s%s", fname, sname ? sname : "");
        if (full_name == NULL) {
            torture_comment(tctx, "talloc_asprintf error\n");
            return false;