aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
blob: e6ac4de00be60b2d1e517624aaab5e2680bf3a0f (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Fix CVE-2020-29385.  Note that we omit the binary test file
tests/test-images/fail/hang_114.gif from the following commit, to avoid
requiring 'git' to apply the patch.


From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001
From: Robert Ancell <robert.ancell@canonical.com>
Date: Mon, 30 Nov 2020 12:26:12 +1300
Subject: [PATCH] gif: Fix LZW decoder accepting invalid LZW code.

The code value after a reset wasn't being validated, which means we would
accept invalid codes. This could cause an infinite loop in the decoder.

Fixes CVE-2020-29385

Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
---
 gdk-pixbuf/lzw.c                    |  13 +++++++------
 tests/test-images/fail/hang_114.gif | Bin 0 -> 5561 bytes
 2 files changed, 7 insertions(+), 6 deletions(-)
 create mode 100644 tests/test-images/fail/hang_114.gif

diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
index 9e052a6f7..105daf2b1 100644
--- a/gdk-pixbuf/lzw.c
+++ b/gdk-pixbuf/lzw.c
@@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self,
                                 if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) {
                                         if (self->code < self->code_table_size)
                                                 add_code (self, self->code);
-                                        else if (self->code == self->code_table_size)
+                                        else
                                                 add_code (self, self->last_code);
-                                        else {
-                                                /* Invalid code received - just stop here */
-                                                self->last_code = self->eoi_code;
-                                                return output_length;
-                                        }
 
                                         /* When table is full increase code size */
                                         if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX)
                                                 self->code_size++;
                                 }
 
+                                /* Invalid code received - just stop here */
+                                if (self->code >= self->code_table_size) {
+                                        self->last_code = self->eoi_code;
+                                        return output_length;
+                                }
+
                                 /* Convert codeword into indexes */
                                 n_written += write_indexes (self, output + n_written, output_length - n_written);
                         }
enexr-2....This is done so the OpenEXR package can be upgraded to version 3 in a later commit. * gnu/packages/graphics.scm (openexr): Rename to ... (openexr-2): ... new variable. (blender, blender-2.79, openimageio, povray)[inputs]: Adjust accordingly. (ctl)[propagated-inputs]: Likewise. * gnu/packages/animation.scm (synfig)[propagated-inputs]: Likewise. * gnu/packages/gimp.scm (gegl, gimp)[inputs]: Likewise. * gnu/packages/gstreamer.scm (gst-plugins-bad)[inputs]: Likewise. * gnu/packages/image-processing.scm (mia, opencolorio, opencv, vips, gmic, nip2)[inputs]: Likewise. * gnu/packages/image-viewers.scm (luminance-hdr)[inputs]: Likewise. * gnu/packages/image.scm (freeimage, vigra, devil)[inputs]: Likewise. * gnu/packages/kde-frameworks.scm (kimageformats)[inputs]: Likewise. * gnu/packages/kde.scm (krita)[inputs]: Likewise. * gnu/packages/photo.scm (enblend-enfuse, darktable, hugin)[inputs]: Likewise. Signed-off-by: Leo Famulari <leo@famulari.name> Vinicius Monego 2021-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès 2021-08-30gnu: extra-cmake-modules: Avoid dependency on qtbase when on armhf....* gnu/packages/kde-frameworks.scm (extra-cmake-modules)[native-inputs]: Remove QTBASE-5 on armhf-linux. [arguments]: Set #:tests? accordingly. Ludovic Courtès 2021-07-24gnu: Use 'search-input-directory' when looking for tzdata....* gnu/packages/backup.scm (duplicity)[arguments]: Use 'search-input-directory' for "share/zoneinfo". * gnu/packages/bioinformatics.scm (pigx-rnaseq): Likewise. (pigx-bsseq): Likewise. * gnu/packages/calcurse.scm (calcurse): Likewise. * gnu/packages/calendar.scm (date): Likewise. * gnu/packages/compression.scm (lhasa): Likewise. * gnu/packages/cran.scm (r-rstan): Likewise. * gnu/packages/django.scm (python-django): Likewise. * gnu/packages/dlang.scm (ldc-bootstrap): Likewise. * gnu/packages/finance.scm (ledger): Likewise. * gnu/packages/glib.scm (glib): Likewise. * gnu/packages/golang.scm (go-1.4): Likewise. (go-1.14): Likewise. * gnu/packages/kde-frameworks.scm (kcalendarcore): Likewise. (kdelibs4support): Likewise. * gnu/packages/kodi.scm (kodi): Likewise. * gnu/packages/mail.scm (mu): Likewise. * gnu/packages/perl.scm (perl-libtime-parsedate): Likewise. * gnu/packages/python-xyz.scm (python-robotframework): Likewise. (python-dparse): Likewise. * gnu/packages/rrdtool.scm (rrdtool): Likewise. * gnu/packages/statistics.scm (r-with-tests): Likewise. * gnu/packages/vim.scm (vim): Likewise. * gnu/packages/virtualization.scm (ganeti): Likewise. * gnu/packages/vpn.scm (strongswan): Likewise. * gnu/packages/xfce.scm (xfce4-panel): Likewise. * gnu/packages/mate.scm (libmateweather): Use 'search-input-file' for "share/zoneinfo/zone.tab". Ludovic Courtès 2021-07-24gnu: Simplify "Xvbf" invocation in pre-check phases....* gnu/packages/geo.scm (qgis)[arguments]: Simplify invocation of 'Xvfb' in 'check' phase, assuming 'Xvfb' is in $PATH. * gnu/packages/graphics.scm (opensubdiv)[arguments]: Likewise. * gnu/packages/java-graphics.scm (java-piccolo2d-extras)[arguments]: Likewise. * gnu/packages/kde-frameworks.scm (kcontacts)[arguments]: Likewise. (kdeclarative)[arguments]: Likewise. * gnu/packages/kde-multimedia.scm (elisa)[arguments]: Likewise. * gnu/packages/kde-plasma.scm (kscreenlocker)[arguments]: Likewise. * gnu/packages/radio.scm (gnuradio)[arguments]: Likewise. * gnu/packages/education.scm (gcompris-qt)[arguments]: Likewise. * gnu/packages/freedesktop.scm (weston)[arguments]: Likewise. Ludovic Courtès 2021-06-14gnu: Rename qtbase to qtbase-5....This change was automated via the following command: $ git ls-files | xargs sed -i 's/,qtbase)/,qtbase-5)/g' $ git ls-files | xargs sed -i 's/inherit qtbase)/inherit qtbase-5)/g' $ git ls-files | xargs sed -i 's/package-version qtbase)/package-version qtbase-5)/g' $ git checkout etc # to clear some spurious changes This is done so the qtbase package can be upgraded to version 6 in the following commit. Maxim Cournoyer