~ubuntu-branches/ubuntu/trusty/gtk+2.0/trusty-updates

« back to all changes in this revision

Viewing changes to debian/patches/gdkwindow-Fix-event-unref-iteration.patch

  • Committer: Package Import Robot
  • Author(s): Vlad Orlov
  • Date: 2015-07-28 10:17:14 UTC
  • Revision ID: package-import@ubuntu.com-20150728101714-rd9msqcb0etcfpsr
Tags: 2.24.23-0ubuntu1.3
* fix_gdk_event_apply_filters.patch: new patch. Makes gdk_event_apply_filters
  function safe against changes in the filter list, prevents weird crashes in
  various apps. (LP: #1351890)
* gdk-Fix-GdkWindowFilter-internal-refcounting.patch,
  gdkwindow-Fix-event-unref-iteration.patch: new patches. Fix refcounting
  errors after fix_gdk_event_apply_filters.patch, prevent crashes in some
  applications like Spotify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 22eb70adab72a5c14f063ea15f8195087ff1dcd8 Mon Sep 17 00:00:00 2001
 
2
From: Colin Walters <walters@verbum.org>
 
3
Date: Fri, 17 Dec 2010 15:36:51 -0500
 
4
Subject: gdkwindow: Fix event unref iteration
 
5
 
 
6
We were double looping previously which caused a NULL deref.
 
7
 
 
8
(cherry picked from commit d08ff485f28f23427bff1b3aac64ab3f77a8664d)
 
9
 
 
10
Index: gtk+2.0-2.24.23/gdk/gdkwindow.c
 
11
===================================================================
 
12
--- gtk+2.0-2.24.23.orig/gdk/gdkwindow.c        2015-06-03 12:19:20.024225529 +0300
 
13
+++ gtk+2.0-2.24.23/gdk/gdkwindow.c     2015-06-03 12:19:20.000225530 +0300
 
14
@@ -1956,11 +1956,15 @@
 
15
       filters = &private->filters;
 
16
     }
 
17
 
 
18
-  for (tmp_list = *filters; tmp_list; tmp_list = tmp_list->next)
 
19
+  tmp_list = *filters;
 
20
+  while (tmp_list)
 
21
     {
 
22
       GdkEventFilter *iter_filter = tmp_list->data;
 
23
       GList *node;
 
24
 
 
25
+      node = tmp_list;
 
26
+      tmp_list = tmp_list->next;
 
27
+
 
28
       if (iter_filter != filter)
 
29
         continue;
 
30
 
 
31
@@ -1970,9 +1974,6 @@
 
32
       if (filter->ref_count != 0)
 
33
         continue;
 
34
 
 
35
-      node = tmp_list;
 
36
-      tmp_list = tmp_list->next;
 
37
-
 
38
       *filters = g_list_remove_link (*filters, node);
 
39
       g_free (filter);
 
40
       g_list_free_1 (node);