File Terminal-0.4.6-prevent-null-pointer-dereference.patch of Package Terminal

From 61440f863c00076eec981cd020659a4aadc19539 Mon Sep 17 00:00:00 2001
From: Lionel Le Folgoc <mrpouit@gmail.com>
Date: Tue, 08 Feb 2011 16:43:14 +0000
Subject: Protect against NULL borders (bug #7253).

---
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index fb447bb..a5312eb 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1123,8 +1123,16 @@ terminal_screen_vte_resize_window (VteTerminal    *terminal,
    * returns a size in pixels */
 #if VTE_CHECK_VERSION (0, 24, 0)
   gtk_widget_style_get (GTK_WIDGET (terminal), "inner-border", &border, NULL);
-  xpad = border->left + border->right;
-  ypad = border->top + border->bottom;
+  if (border != NULL)
+    {
+      xpad = border->left + border->right;
+      ypad = border->top + border->bottom;
+      gtk_border_free (border);
+    }
+  else
+    {
+      xpad = ypad = 0;
+    }
 #else
   vte_terminal_get_padding (terminal, &xpad, &ypad);
 #endif
@@ -1606,8 +1614,16 @@ terminal_screen_force_resize_window (TerminalScreen *screen,
 
 #if VTE_CHECK_VERSION (0, 24, 0)
   gtk_widget_style_get (GTK_WIDGET (screen->terminal), "inner-border", &border, NULL);
-  xpad = border->left + border->right;
-  ypad = border->top + border->bottom;
+  if (border != NULL)
+    {
+      xpad = border->left + border->right;
+      ypad = border->top + border->bottom;
+      gtk_border_free (border);
+    }
+  else
+    {
+      xpad = ypad = 0;
+    }
 #else
   vte_terminal_get_padding (VTE_TERMINAL (screen->terminal), &xpad, &ypad);
 #endif
--
cgit v0.8.3.4
openSUSE Build Service is sponsored by