s3: smbd: Fix NULL pointer bug introduced by previous 'raw' stream fix (bug #11522).
authorJeremy Allison <jra@samba.org>
Thu, 1 Oct 2015 00:12:11 +0000 (17:12 -0700)
committerRalph Böhme <slow@samba.org>
Thu, 1 Oct 2015 06:58:36 +0000 (08:58 +0200)
Ensure dirpath can never be NULL.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct  1 08:58:36 CEST 2015 on sn-devel-104

source3/smbd/filename.c

index 48814a5790258a3bedd304131656b9a2fe0dfe6a..555658de0149a9d19f9b77022d447ad8f97cd48d 100644 (file)
@@ -388,6 +388,12 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                        status = map_nt_error_from_unix(errno);
                                        goto err;
                                }
+                               /* dirpath must exist. */
+                               dirpath = talloc_strdup(ctx,"");
+                               if (dirpath == NULL) {
+                                       status = NT_STATUS_NO_MEMORY;
+                                       goto err;
+                               }
                                DEBUG(5, ("conversion finished %s -> %s\n",
                                        orig_path,
                                        smb_fname->base_name));