[PATCH] vfs_catia: Fix bug 11827

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Apr 11 06:02:27 UTC 2016


Hi!

Attached find a bugfix and a small cleanup. The bug reporter has
confirmed the fix.

Review appreciated!

Thanks, Volker

-- 
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 at sernet.de
-------------- next part --------------
From 4c585a469f0ec8816305c0b34675100b35936408 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sun, 10 Apr 2016 13:09:29 +0200
Subject: [PATCH 1/2] vfs_catia: Align loop index with terminator

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_catia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index c5d2b6a..8622c24 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -805,7 +805,7 @@ catia_streaminfo(struct vfs_handle_struct *handle,
 {
 	char *mapped_name = NULL;
 	NTSTATUS status;
-	int i;
+	unsigned int i;
 	struct smb_filename *catia_smb_fname = NULL;
 	unsigned int num_streams = 0;
 	struct stream_struct *streams = NULL;
-- 
2.1.4


From cf3ee4a70cf86fe0f3c026ae9b431b8f059592b9 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sun, 10 Apr 2016 12:51:15 +0200
Subject: [PATCH 2/2] vfs_catia: Fix bug 11827, memleak

add_srt should add the mappings to the linked list even if
mappings==NULL (the default)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11827
Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_catia.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 8622c24..f4c77d9 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -141,6 +141,9 @@ static struct share_mapping_entry *add_srt(int snum, const char **mappings)
 
 	ret->snum = snum;
 
+	ret->next = srt_head;
+	srt_head = ret;
+
 	if (mappings) {
 		ret->mappings = (struct char_mappings**) ((unsigned char*) ret +
 		    sizeof(struct share_mapping_entry));
@@ -176,9 +179,6 @@ static struct share_mapping_entry *add_srt(int snum, const char **mappings)
 		}
 	}
 
-	ret->next = srt_head;
-	srt_head = ret;
-
 	return ret;
 }
 
-- 
2.1.4



More information about the samba-technical mailing list