aboutsummaryrefslogtreecommitdiffstats
path: root/community/graphicsmagick/CVE-2017-11642.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-08-24 08:51:03 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-08-24 08:59:20 +0000
commit887ce5de6251962b5d71a2d3af7a7f39871cf394 (patch)
treede9ac87b8578d1ec3035fbd63038f857272d9d1c /community/graphicsmagick/CVE-2017-11642.patch
parent8ec38c157f3b02dbfaeae70d88c36709642a3327 (diff)
downloadaports-887ce5de6251962b5d71a2d3af7a7f39871cf394.tar.bz2
aports-887ce5de6251962b5d71a2d3af7a7f39871cf394.tar.xz
community/graphicsmagick: security fixes for various CVEs:
Diffstat (limited to 'community/graphicsmagick/CVE-2017-11642.patch')
-rw-r--r--community/graphicsmagick/CVE-2017-11642.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/community/graphicsmagick/CVE-2017-11642.patch b/community/graphicsmagick/CVE-2017-11642.patch
new file mode 100644
index 0000000000..144ed78e7e
--- /dev/null
+++ b/community/graphicsmagick/CVE-2017-11642.patch
@@ -0,0 +1,43 @@
+
+# HG changeset patch
+# User Bob Friesenhahn <bfriesen@GraphicsMagick.org>
+# Date 1500758975 18000
+# Node ID 29550606d8b9bf74f9aea0637d11d19fe706871b
+# Parent 30cd2b31f7e045de4861b102e3f8d83db579bc7a
+MAP: Fix null pointer dereference or SEGV if input is not colormapped.
+
+diff -r 30cd2b31f7e0 -r 29550606d8b9 coders/map.c
+--- a/coders/map.c Sat Jul 22 15:40:00 2017 -0500
++++ b/coders/map.c Sat Jul 22 16:29:35 2017 -0500
+@@ -18,7 +18,7 @@
+ % M M A A P %
+ % %
+ % %
+-% Read/Write Image Colormaps As An Image File %
++% Read/Write Image Colormaps And Image File %
+ % %
+ % %
+ % Software Design %
+@@ -349,16 +349,17 @@
+ /*
+ Allocate colormap.
+ */
+- if (!IsPaletteImage(image,&image->exception))
+- (void) SetImageType(image,PaletteType);
++ if (SetImageType(image,PaletteType) == MagickFail)
++ ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image);
+ packet_size=image->depth > 8 ? 2 : 1;
+- pixels=MagickAllocateMemory(unsigned char *,image->columns*packet_size);
++ pixels=MagickAllocateArray(unsigned char *,image->columns,packet_size);
+ if (pixels == (unsigned char *) NULL)
+ ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image);
+ packet_size=image->colors > 256 ? 6 : 3;
+- colormap=MagickAllocateMemory(unsigned char *,packet_size*image->colors);
++ colormap=MagickAllocateArray(unsigned char *,packet_size,image->colors);
+ if (colormap == (unsigned char *) NULL)
+ ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image);
++
+ /*
+ Write colormap to file.
+ */
+