public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/nautilus/, gnome-base/nautilus/files/
Date: Mon, 30 May 2011 18:39:14 +0000 (UTC)	[thread overview]
Message-ID: <4ef658e0178b95b19e6d63e4ec0d759dae84b5e9.nirbheek@gentoo> (raw)

commit:     4ef658e0178b95b19e6d63e4ec0d759dae84b5e9
Author:     Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
AuthorDate: Fri May 27 06:31:53 2011 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Mon May 30 18:10:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=4ef658e0

gnome-base/nautilus: 3.0.1.1 → 3.0.2

* Add patch to fix bug #365779 (segfault in gtk_icon_info_load_symbolic
  when nautilus fails to find an icon).

Signed-off-by: Nirbheek Chauhan <nirbheek <AT> gentoo.org>

---
 ...2-segfault-in-gtk_icon_info_load_symbolic.patch |   88 ++++++++++++++++++++
 ...utilus-3.0.1.1.ebuild => nautilus-3.0.2.ebuild} |    3 +
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch b/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch
new file mode 100644
index 0000000..82781f7
--- /dev/null
+++ b/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch
@@ -0,0 +1,88 @@
+From a37ecf869f4772b1ea3b578b687b5b83dd4bd067 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gmail.com>
+Date: Fri, 27 May 2011 01:10:24 -0400
+Subject: [PATCH] Prevent segfault in gtk_icon_info_load_symbolic when icon is not found (gnome bug 651209)
+
+Users of Gentoo and Fedora have reported segfaults in nautilus-3.0.x
+in gtk_icon_info_load_symbolic (see Gentoo bug 365779, Fedora bug
+690357). One of them was helpful enough to post a backtrace with
+debugging information: https://bugzilla.redhat.com/attachment.cgi?id=489928
+
+The backtrace shows that the crash occurs because we are passing a
+NULL icon_info to gtk_icon_info_load_symbolic in lookup_and_color_symbolic_find
+in nautilus-search-bar.c; indeed, icon_info will be NULL if
+gtk_icon_theme_lookup_icon fails to find an icon.
+
+An identical problem exists in get_eject_icon in nautilus-places-sidebar.c,
+where gtk_icon_info_load_symbolic_for_context and
+gtk_icon_theme_lookup_by_gicon are used.
+
+The solution is to check for the NULL icon_info, and return a
+NULL GdkPixbuf. Note that returning a NULL from
+lookup_and_color_symbolic_find and get_eject_icon is
+safe: in both cases, the return value is only used in functions
+that can safely deal with a NULL.
+---
+ src/nautilus-places-sidebar.c |   11 ++++++-----
+ src/nautilus-search-bar.c     |    9 +++++----
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
+index aa08f14..de53cd1 100644
+--- a/src/nautilus-places-sidebar.c
++++ b/src/nautilus-places-sidebar.c
+@@ -214,7 +214,7 @@ static GdkPixbuf *
+ get_eject_icon (NautilusPlacesSidebar *sidebar,
+ 		gboolean highlighted)
+ {
+-	GdkPixbuf *eject;
++	GdkPixbuf *eject = NULL;
+ 	GtkIconInfo *icon_info;
+ 	GIcon *icon;
+ 	int icon_size;
+@@ -227,10 +227,11 @@ get_eject_icon (NautilusPlacesSidebar *sidebar,
+ 	icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0);
+ 
+ 	style = gtk_widget_get_style_context (GTK_WIDGET (sidebar));
+-	eject = gtk_icon_info_load_symbolic_for_context (icon_info,
+-							 style,
+-							 NULL,
+-							 NULL);
++	if (icon_info != NULL)
++		eject = gtk_icon_info_load_symbolic_for_context (icon_info,
++								 style,
++								 NULL,
++								 NULL);
+ 
+ 	if (highlighted) {
+ 		GdkPixbuf *high;
+diff --git a/src/nautilus-search-bar.c b/src/nautilus-search-bar.c
+index 6148807..17412d9 100644
+--- a/src/nautilus-search-bar.c
++++ b/src/nautilus-search-bar.c
+@@ -160,7 +160,7 @@ lookup_and_color_symbolic_find (NautilusSearchBar *bar)
+ {
+ 	GtkIconInfo *icon_info;
+ 	GdkRGBA color;
+-	GdkPixbuf *icon;
++	GdkPixbuf *icon = NULL;
+ 	GtkStyleContext *context;
+ 
+ 	context = gtk_widget_get_style_context (GTK_WIDGET (bar));
+@@ -172,9 +172,10 @@ lookup_and_color_symbolic_find (NautilusSearchBar *bar)
+ 						"edit-find-symbolic",
+ 						nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU),
+ 						GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+-	icon = gtk_icon_info_load_symbolic (icon_info, &color,
+-					    NULL, NULL, NULL,
+-					    NULL, NULL);
++	if (icon_info != NULL)
++		icon = gtk_icon_info_load_symbolic (icon_info, &color,
++						    NULL, NULL, NULL,
++						    NULL, NULL);
+ 
+ 	gtk_style_context_restore (context);
+ 
+-- 
+1.7.5.rc3
+

diff --git a/gnome-base/nautilus/nautilus-3.0.1.1.ebuild b/gnome-base/nautilus/nautilus-3.0.2.ebuild
similarity index 93%
rename from gnome-base/nautilus/nautilus-3.0.1.1.ebuild
rename to gnome-base/nautilus/nautilus-3.0.2.ebuild
index f8fb449..da2ec5a 100644
--- a/gnome-base/nautilus/nautilus-3.0.1.1.ebuild
+++ b/gnome-base/nautilus/nautilus-3.0.2.ebuild
@@ -65,6 +65,9 @@ pkg_setup() {
 }
 
 src_prepare() {
+	# Gentoo bug #365779 + https://bugzilla.gnome.org/show_bug.cgi?id=651209
+	epatch "${FILESDIR}/${PN}-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch"
+
 	gnome2_src_prepare
 
 	# Remove crazy CFLAGS



             reply	other threads:[~2011-05-30 18:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30 18:39 Nirbheek Chauhan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-04-02  6:43 [gentoo-commits] proj/gnome:master commit in: gnome-base/nautilus/, gnome-base/nautilus/files/ Alexandre Restovtsev
2012-08-27  7:11 Priit Laes
2012-09-05 15:49 Nirbheek Chauhan
2012-09-30  3:24 Alexandre Rostovtsev
2015-04-26 14:01 Ole Reifschneider
2018-09-16 15:25 Sobhan Mohammadpour
2018-12-11 13:54 Gilles Dartiguelongue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ef658e0178b95b19e6d63e4ec0d759dae84b5e9.nirbheek@gentoo \
    --to=nirbheek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox