[mate-user-share] 01/02: debian/patches: Add 0001_mem-leak-fix.patch, 0002_array-out-of-bounds.patch. Fix memory leak and out-of-bounds access to array if bluetooth is disabled. (Closes: #779821).

Mike Gabriel sunweaver at debian.org
Tue Mar 10 18:57:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository mate-user-share.

commit 2b2f89a3335b78c803029fdc3e9613636e8af04e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Mar 10 15:32:52 2015 +0100

    debian/patches: Add 0001_mem-leak-fix.patch, 0002_array-out-of-bounds.patch. Fix memory leak and out-of-bounds access to array if bluetooth is disabled. (Closes: #779821).
---
 debian/patches/0001_mem-leak-fix.patch        | 47 +++++++++++++++++++++++++++
 debian/patches/0002_array-out-of-bounds.patch | 47 +++++++++++++++++++++++++++
 debian/patches/series                         |  3 +-
 3 files changed, 96 insertions(+), 1 deletion(-)

diff --git a/debian/patches/0001_mem-leak-fix.patch b/debian/patches/0001_mem-leak-fix.patch
new file mode 100644
index 0000000..4092171
--- /dev/null
+++ b/debian/patches/0001_mem-leak-fix.patch
@@ -0,0 +1,47 @@
+From 18acac35d5015196431b5fc5f0291c860ea2ea1b Mon Sep 17 00:00:00 2001
+From: Monsta <monsta at inbox.ru>
+Date: Wed, 19 Nov 2014 21:22:41 +0300
+Subject: [PATCH] don't leak memory
+
+---
+ src/http.c            | 1 +
+ src/share-extension.c | 6 +++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/http.c b/src/http.c
+index 71161cd..36d058a 100644
+--- a/src/http.c
++++ b/src/http.c
+@@ -397,6 +397,7 @@ spawn_httpd (int port, pid_t *pid_out)
+ 		fprintf (stderr, "error spawning httpd: %s\n",
+ 			 error->message);
+ 		g_error_free (error);
++		g_free (pid_filename);
+ 		return FALSE;
+ 	}
+ 
+diff --git a/src/share-extension.c b/src/share-extension.c
+index bbc34ff..e0edbce 100644
+--- a/src/share-extension.c
++++ b/src/share-extension.c
+@@ -168,6 +168,8 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
+ 		g_object_unref (dir);
+ 	}
+ 
++	g_object_unref (file);
++
+ 	if (enable == FALSE)
+ 		return NULL;
+ 
+@@ -200,9 +202,7 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
+ 
+ 	gtk_widget_show_all (bar);
+ 
+-	g_object_unref (file);
+-
+-        return bar;
++	return bar;
+ }
+ 
+ static void
+
diff --git a/debian/patches/0002_array-out-of-bounds.patch b/debian/patches/0002_array-out-of-bounds.patch
new file mode 100644
index 0000000..3490da9
--- /dev/null
+++ b/debian/patches/0002_array-out-of-bounds.patch
@@ -0,0 +1,47 @@
+From 3e24f8f3a3afbbb15785ffc19623c020b4edc8a9 Mon Sep 17 00:00:00 2001
+From: Monsta <monsta at inbox.ru>
+Date: Wed, 19 Nov 2014 21:18:59 +0300
+Subject: [PATCH] fixed logic flaw (out-of-bounds array access if bluetooth is
+ disabled)
+
+---
+ src/share-extension.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/src/share-extension.c b/src/share-extension.c
+index e0edbce..429d26d 100644
+--- a/src/share-extension.c
++++ b/src/share-extension.c
+@@ -145,7 +145,7 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
+ 	const GUserDirectory special_dirs[] = { G_USER_DIRECTORY_PUBLIC_SHARE };
+ 
+ 	gboolean is_dir[] = { FALSE };
+-#endif
++#endif /* HAVE_BLUETOOTH */
+ 	file = g_file_new_for_uri (uri);
+ 	home = g_file_new_for_path (g_get_home_dir ());
+ 
+@@ -173,14 +173,16 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
+ 	if (enable == FALSE)
+ 		return NULL;
+ 
+-	if (is_dir[0] != FALSE && is_dir[1] != FALSE) {
+-		bar = caja_share_bar_new (_("May be used to share or receive files"));
+-	} else if (is_dir[0] != FALSE) {
+-#ifndef HAVE_BLUETOOTH
+-		bar = caja_share_bar_new (_("May be shared over the network or Bluetooth"));
++	if (is_dir[0] != FALSE) {
++#ifdef HAVE_BLUETOOTH
++		if (is_dir[1] != FALSE) {
++			bar = caja_share_bar_new (_("May be used to share or receive files"));
++		} else {
++			bar = caja_share_bar_new (_("May be shared over the network or Bluetooth"));
++		}
+ #else
+ 		bar = caja_share_bar_new (_("May be shared over the network"));
+-#endif /* !HAVE_BLUETOOTH */
++#endif /* HAVE_BLUETOOTH */
+ 	} else {
+ #ifdef HAVE_BLUETOOTH
+ 		BluetoothClient *client;
+
diff --git a/debian/patches/series b/debian/patches/series
index 4d1f8b6..dcde3f7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
+0001_mem-leak-fix.patch
+0002_array-out-of-bounds.patch
 1001_apache-config.patch
 1002_add-keywords-key-to-desktop-files.patch
 2001_omit-gfdl-licensed-help-files.patch
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-user-share.git



More information about the pkg-mate-commits mailing list