[gtk+/gtk-3-22] Avoid a possible crash in ::activate-url handlers
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] Avoid a possible crash in ::activate-url handlers
- Date: Thu, 29 Dec 2016 16:08:41 +0000 (UTC)
commit f19ecbb8503982a00b0f3ee4d5d6c3c73e61deb2
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Dec 29 11:07:05 2016 -0500
Avoid a possible crash in ::activate-url handlers
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.
gtk/gtklabel.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 3affe96..612ad3f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -6739,7 +6739,8 @@ emit_activate_link (GtkLabel *label,
GtkStateFlags state;
g_signal_emit (label, signals[ACTIVATE_LINK], 0, link->uri, &handled);
- if (handled && priv->track_links && !link->visited)
+ if (handled && priv->track_links && !link->visited &&
+ priv->select_info && priv->select_info->links)
{
link->visited = TRUE;
state = gtk_css_node_get_state (link->cssnode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]