summaryrefslogtreecommitdiff
path: root/user/atril/CVE-2019-11459.patch
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2019-09-13 03:43:28 -0500
committerMax Rees <maxcrees@me.com>2019-09-13 19:01:40 -0500
commit94981d3fd78388a8d75ab142fb91c70859e72de7 (patch)
treef821db88833c0bf434408e957ae4ead3abff299e /user/atril/CVE-2019-11459.patch
parentcca88ac9d025aa517208599dd7877e87548289d3 (diff)
downloadpackages-94981d3fd78388a8d75ab142fb91c70859e72de7.tar.gz
packages-94981d3fd78388a8d75ab142fb91c70859e72de7.tar.bz2
packages-94981d3fd78388a8d75ab142fb91c70859e72de7.tar.xz
packages-94981d3fd78388a8d75ab142fb91c70859e72de7.zip
user/atril: [CVE] patch CVE-2019-11459 (#148)
Also, add secfixes comment and use upstream patch for CVE-2019-1010006 (#178)
Diffstat (limited to 'user/atril/CVE-2019-11459.patch')
-rw-r--r--user/atril/CVE-2019-11459.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/user/atril/CVE-2019-11459.patch b/user/atril/CVE-2019-11459.patch
new file mode 100644
index 000000000..a826cbd29
--- /dev/null
+++ b/user/atril/CVE-2019-11459.patch
@@ -0,0 +1,69 @@
+Backport of the following, since it did not apply due to whitespace /
+formatting
+
+From bd4ce9171fef52720e74ffeeeeca3b0c5b5d4808 Mon Sep 17 00:00:00 2001
+From: Victor Kareh <vkareh@redhat.com>
+Date: Sun, 11 Aug 2019 05:20:09 +0300
+Subject: [PATCH] tiff: Handle failure from TIFFReadRGBAImageOriented
+
+The TIFFReadRGBAImageOriented function returns zero if it was unable to
+read the image. Return NULL in this case instead of displaying
+uninitialized memory.
+
+This addresses CVE-2019-11459
+
+upstream commit:
+https://gitlab.gnome.org/GNOME/evince/commit/234f034a4
+---
+
+--- atril-1.22.1/backend/tiff/tiff-document.c
++++ atril-1.22.1/backend/tiff/tiff-document.c
+@@ -282,17 +282,21 @@ tiff_document_render (EvDocument *d
+ return NULL;
+ }
+
++ if (!TIFFReadRGBAImageOriented (tiff_document->tiff,
++ width, height,
++ (uint32 *)pixels,
++ orientation, 0)) {
++ g_warning ("Failed to read TIFF image.");
++ g_free (pixels);
++ return NULL;
++ }
++
+ surface = cairo_image_surface_create_for_data (pixels,
+ CAIRO_FORMAT_RGB24,
+ width, height,
+ rowstride);
+ cairo_surface_set_user_data (surface, &key,
+ pixels, (cairo_destroy_func_t)g_free);
+-
+- TIFFReadRGBAImageOriented (tiff_document->tiff,
+- width, height,
+- (uint32 *)pixels,
+- orientation, 0);
+ pop_handlers ();
+
+ /* Convert the format returned by libtiff to
+@@ -373,13 +377,17 @@ tiff_document_render_pixbuf (EvDocument
+ if (!pixels)
+ return NULL;
+
++ if (!TIFFReadRGBAImageOriented (tiff_document->tiff,
++ width, height,
++ (uint32 *)pixels,
++ ORIENTATION_TOPLEFT, 0)) {
++ g_free (pixels);
++ return NULL;
++ }
++
+ pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, TRUE, 8,
+ width, height, rowstride,
+ (GdkPixbufDestroyNotify) g_free, NULL);
+- TIFFReadRGBAImageOriented (tiff_document->tiff,
+- width, height,
+- (uint32 *)pixels,
+- ORIENTATION_TOPLEFT, 0);
+ pop_handlers ();
+
+ scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf,