[PATCH] Patch for bug 11535

Ralph Böhme rb at sernet.de
Wed Sep 30 23:09:00 UTC 2015


Hi,

adding a NULL check seems to be the natural thing to fix a crash I hit
when running MTM. This passes a private autobuild, so fingers crossed.

Please review&push if ok. Thanks!

-slow

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de
-------------- next part --------------
From 03e690fdd2b93c3d5967ca8be0eb224970ddef9b Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 25 Sep 2015 21:06:57 +0200
Subject: [PATCH] s3: smbd: fix a crash in unix_convert()

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 at samba.org>
---
 source3/smbd/filename.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 3ed60e2..48814a5 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -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 {
-- 
2.1.0



More information about the samba-technical mailing list