aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdk-pixbuf/CVE-2017-6312.patch
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-06-16 08:24:59 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-06-16 08:27:01 +0000
commite316d123f313509137f4eb26ae3ba6b2266a9e93 (patch)
treef300ee0c2cdca248d36e323532f81d9c9d966bf6 /main/gdk-pixbuf/CVE-2017-6312.patch
parentcc6906bf6918602b60bb9b31ae545a8e2ab43e7a (diff)
downloadaports-e316d123f313509137f4eb26ae3ba6b2266a9e93.tar.bz2
aports-e316d123f313509137f4eb26ae3ba6b2266a9e93.tar.xz
main/gdk-pixbuf: security fixes (CVE-2017-6311, CVE-2017-6312, CVE-2017-6314)
CVE-2017-6313: fix N/A, https://bugzilla.gnome.org/show_bug.cgi?id=779016
Diffstat (limited to 'main/gdk-pixbuf/CVE-2017-6312.patch')
-rw-r--r--main/gdk-pixbuf/CVE-2017-6312.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/gdk-pixbuf/CVE-2017-6312.patch b/main/gdk-pixbuf/CVE-2017-6312.patch
new file mode 100644
index 0000000000..3cd9bbe757
--- /dev/null
+++ b/main/gdk-pixbuf/CVE-2017-6312.patch
@@ -0,0 +1,25 @@
+--- a/gdk-pixbuf/io-ico.c
++++ a/gdk-pixbuf/io-ico.c
+@@ -330,10 +330,8 @@ static void DecodeHeader(guchar *Data, gint Bytes,
+ return;
+ }
+
+- /* We know how many bytes are in the "header" part. */
+- State->HeaderSize = entry->DIBoffset + INFOHEADER_SIZE;
+-
+- if (State->HeaderSize < 0) {
++ /* Avoid invoking undefined behavior in the State->HeaderSize calculation below */
++ if (entry->DIBoffset > G_MAXINT - INFOHEADER_SIZE) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+@@ -341,6 +339,9 @@ static void DecodeHeader(guchar *Data, gint Bytes,
+ return;
+ }
+
++ /* We know how many bytes are in the "header" part. */
++ State->HeaderSize = entry->DIBoffset + INFOHEADER_SIZE;
++
+ if (State->HeaderSize>State->BytesInHeaderBuf) {
+ guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize);
+ if (!tmp) {