~ubuntu-branches/ubuntu/precise/zenity/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/git_list_view_segfault.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-05-04 08:43:26 UTC
  • mfrom: (62.1.1 precise)
  • Revision ID: package-import@ubuntu.com-20120504084326-gw2eyj1mmdyu1cd3
Tags: 3.4.0-0ubuntu3
* debian/patches/git_list_view_segfault.patch:
  - don't segfault when using the --list option (lp: #968534)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 4a30be17b3adfd7b8383f5c23fae71e31933326b Mon Sep 17 00:00:00 2001
 
2
From: Arx Cruz <arxcruz@gnome.org>
 
3
Date: Tue, 17 Apr 2012 19:50:52 +0000
 
4
Subject: Bug #673529 Fix segmentation fault in --list option
 
5
 
 
6
---
 
7
diff --git a/src/tree.c b/src/tree.c
 
8
index ad4a6d1..721817e 100644
 
9
--- a/src/tree.c
 
10
+++ b/src/tree.c
 
11
@@ -120,13 +120,13 @@ zenity_tree_handle_stdin (GIOChannel  *channel,
 
12
 
 
13
     string = g_string_new (NULL);
 
14
 
 
15
-    while (channel->is_readable != TRUE)
 
16
+    while (g_io_channel_get_flags(channel) != G_IO_FLAG_IS_READABLE)
 
17
       ;
 
18
     do {
 
19
       gint status;
 
20
 
 
21
       do {
 
22
-        if (channel->is_readable == TRUE)
 
23
+        if (g_io_channel_get_flags(channel) == G_IO_FLAG_IS_READABLE)
 
24
           status = g_io_channel_read_line_string (channel, string, NULL, &error);
 
25
         else
 
26
           return FALSE;
 
27
@@ -645,7 +645,7 @@ zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data)
 
28
       zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
 
29
       break;
 
30
   }
 
31
-  if (channel->is_readable == TRUE)
 
32
+  if (channel != NULL && g_io_channel_get_flags (channel) == G_IO_FLAG_IS_READABLE)
 
33
     g_io_channel_shutdown (channel, TRUE, NULL);
 
34
 
 
35
   gtk_main_quit ();
 
36
--
 
37
cgit v0.9.0.2
 
38