s3: smbd: fix a crash in unix_convert()
authorRalph Boehme <slow@samba.org>
Fri, 25 Sep 2015 19:06:57 +0000 (21:06 +0200)
committerRalph Böhme <slow@samba.org>
Thu, 1 Oct 2015 03:56:10 +0000 (05:56 +0200)
Some error code paths may result in dirpath being NULL.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11535

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/filename.c

index 3ed60e26a0170fb3615c6188e144d8c6f052dabe..48814a5790258a3bedd304131656b9a2fe0dfe6a 100644 (file)
@@ -1013,7 +1013,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
        return NT_STATUS_OK;
  fail:
        DEBUG(10, ("dirpath = [%s] start = [%s]\n", dirpath, start));
-       if (*dirpath != '\0') {
+       if (dirpath && *dirpath != '\0') {
                smb_fname->base_name = talloc_asprintf(smb_fname, "%s/%s",
                                                       dirpath, start);
        } else {