[xsane] don't dereference NULL preview objects when quitting (#963696)

Nils Philippsen nphilipp at fedoraproject.org
Fri May 17 12:27:50 UTC 2013


commit 31dc8f91a9a76053ac52a2f69bdbe943405ef950
Author: Nils Philippsen <nils at redhat.com>
Date:   Fri May 17 14:26:22 2013 +0200

    don't dereference NULL preview objects when quitting (#963696)

 xsane-0.998-null-preview-crash.patch       |   44 ++++++++++++++++++++++++++++
 xsane-0.998-xsane_update_param-crash.patch |   32 --------------------
 xsane.spec                                 |   35 ++++++++++++----------
 3 files changed, 63 insertions(+), 48 deletions(-)
---
diff --git a/xsane-0.998-null-preview-crash.patch b/xsane-0.998-null-preview-crash.patch
new file mode 100644
index 0000000..8506710
--- /dev/null
+++ b/xsane-0.998-null-preview-crash.patch
@@ -0,0 +1,44 @@
+From 7b47e322551f1c2ffe38e2f6f8cfde1b9de084ec Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Fri, 17 May 2013 14:14:55 +0200
+Subject: [PATCH] patch: null-preview-crash
+
+Squashed commit of the following:
+
+commit c9b1ee0aaf9701f6d3bd14b32354fa5b2bcd1433
+Author: Nils Philippsen <nils at redhat.com>
+Date:   Fri May 17 14:14:28 2013 +0200
+
+    don't dereference xsane.preview if it is NULL
+---
+ src/xsane-front-gtk.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
+index 08761a0..8502c03 100644
+--- a/src/xsane-front-gtk.c
++++ b/src/xsane-front-gtk.c
+@@ -1713,7 +1713,7 @@ void xsane_update_param(void *arg)
+   gtk_label_set(GTK_LABEL(xsane.info_label), buf);
+ 
+ 
+-  if (xsane.preview->surface_unit == SANE_UNIT_MM)
++  if (xsane.preview && xsane.preview->surface_unit == SANE_UNIT_MM)
+   {
+    double dx, dy;
+ 
+@@ -1728,7 +1728,10 @@ void xsane_update_param(void *arg)
+ 
+   xsane_update_histogram(TRUE /* update raw */);
+ 
+-  preview_display_valid(xsane.preview);
++  if (xsane.preview)
++  {
++    preview_display_valid(xsane.preview);
++  }
+ }
+ 
+ /* ---------------------------------------------------------------------------------------------------------------------- */
+-- 
+1.8.1.4
+
diff --git a/xsane.spec b/xsane.spec
index 4c2e8dd..2f31e99 100644
--- a/xsane.spec
+++ b/xsane.spec
@@ -39,28 +39,30 @@ Patch4: xsane-0.997-no-file-selected.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=198422
 # submitted to upstream (Oliver Rauch) via email, 2010-06-29
 Patch5: xsane-0.997-ipv6.patch
-# https://bugzilla.redhat.com/show_bug.cgi?id=693224
-# submitted to upstream (Oliver Rauch) via email, 2011-04-04
-Patch6: xsane-0.998-xsane_update_param-crash.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=624190
 # fix from: https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/370818
 # submitted to upstream (Oliver Rauch) via email, 2011-06-01
-Patch7: xsane-0.998-preview-selection.patch
+Patch6: xsane-0.998-preview-selection.patch
 # build with libpng-1.5
 # submitted to upstream (Oliver Rauch) via email, 2011-11-21
-Patch8: xsane-0.998-libpng.patch
+Patch7: xsane-0.998-libpng.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=795085
 # distro-specific: set program name/wmclass so GNOME shell picks appropriate
 # high resolution icon file
-Patch9: xsane-0.998-wmclass.patch
+Patch8: xsane-0.998-wmclass.patch
 # calculate minimum window size better for multi-head setups
 # submitted to upstream (Oliver Rauch) via email, 2012-09-03
-Patch10: xsane-0.998-preview-window-size.patch
+Patch9: xsane-0.998-preview-window-size.patch
 # correct some typos in the man page, original patch by John Bradshaw
 # submitted to upstream (Oliver Rauch) via email, 2012-09-03
-Patch11: xsane-0.998-man.patch
+Patch10: xsane-0.998-man.patch
 # distro-specific: customize desktop file
-Patch12: xsane-0.998-desktop-file.patch
+Patch11: xsane-0.998-desktop-file.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=693224
+# https://bugzilla.redhat.com/show_bug.cgi?id=963696
+# submitted to upstream (Oliver Rauch) via email, 2011-04-04 and (updated
+# patch) 2013-05-17
+Patch12: xsane-0.998-null-preview-crash.patch
 # autoconf-generated files
 Patch100: xsane-0.998-1-autoconf.patch.bz2
 License: GPLv2+
@@ -119,13 +121,13 @@ done
 %patch3 -p1 -b .off-root-build
 %patch4 -p1 -b .no-file-selected
 %patch5 -p1 -b .ipv6
-%patch6 -p1 -b .xsane_update_param-crash
-%patch7 -p1 -b .preview-selection.patch
-%patch8 -p1 -b .libpng
-%patch9 -p1 -b .wmclass
-%patch10 -p1 -b .preview-window-size
-%patch11 -p1 -b .man
-%patch12 -p1 -b .desktop-file
+%patch6 -p1 -b .preview-selection.patch
+%patch7 -p1 -b .libpng
+%patch8 -p1 -b .wmclass
+%patch9 -p1 -b .preview-window-size
+%patch10 -p1 -b .man
+%patch11 -p1 -b .desktop-file
+%patch12 -p1 -b .null-preview-crash
 
 %patch100 -p1 -b .autoconf
 
@@ -231,6 +233,7 @@ fi
 
 %changelog
 * Fri May 17 2013 Nils Philippsen <nils at redhat.com>
+- don't dereference NULL preview objects when quitting (#963696)
 - fix vendor tag logic in a prettier way
 
 * Tue May 14 2013 Jon Ciesla <limburgher at gmail.com> - 0.998-20


More information about the scm-commits mailing list