summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch')
-rw-r--r--meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch110
1 files changed, 0 insertions, 110 deletions
diff --git a/meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch b/meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch
deleted file mode 100644
index 344f34feb..000000000
--- a/meta-oe/recipes-support/gd/gd/CVE-2018-14553.patch
+++ /dev/null
@@ -1,110 +0,0 @@
1From a93eac0e843148dc2d631c3ba80af17e9c8c860f Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?F=C3=A1bio=20Cabral=20Pacheco?= <fcabralpacheco@gmail.com>
3Date: Fri, 20 Dec 2019 12:03:33 -0300
4Subject: [PATCH] Fix potential NULL pointer dereference in gdImageClone()
5
6---
7 src/gd.c | 9 +--------
8 tests/gdimageclone/.gitignore | 1 +
9 tests/gdimageclone/CMakeLists.txt | 1 +
10 tests/gdimageclone/Makemodule.am | 3 ++-
11 tests/gdimageclone/style.c | 30 ++++++++++++++++++++++++++++++
12 5 files changed, 35 insertions(+), 9 deletions(-)
13 create mode 100644 tests/gdimageclone/style.c
14
15diff --git a/src/gd.c b/src/gd.c
16index 592a028..d564d1f 100644
17--- a/src/gd.c
18+++ b/src/gd.c
19@@ -2865,14 +2865,6 @@ BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) {
20 }
21 }
22
23- if (src->styleLength > 0) {
24- dst->styleLength = src->styleLength;
25- dst->stylePos = src->stylePos;
26- for (i = 0; i < src->styleLength; i++) {
27- dst->style[i] = src->style[i];
28- }
29- }
30-
31 dst->interlace = src->interlace;
32
33 dst->alphaBlendingFlag = src->alphaBlendingFlag;
34@@ -2907,6 +2899,7 @@ BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) {
35
36 if (src->style) {
37 gdImageSetStyle(dst, src->style, src->styleLength);
38+ dst->stylePos = src->stylePos;
39 }
40
41 for (i = 0; i < gdMaxColors; i++) {
42diff --git a/tests/gdimageclone/.gitignore b/tests/gdimageclone/.gitignore
43index a70782d..f4129cc 100644
44--- a/tests/gdimageclone/.gitignore
45+++ b/tests/gdimageclone/.gitignore
46@@ -1 +1,2 @@
47 /bug00300
48+/style
49diff --git a/tests/gdimageclone/CMakeLists.txt b/tests/gdimageclone/CMakeLists.txt
50index e6ccc31..662f4e9 100644
51--- a/tests/gdimageclone/CMakeLists.txt
52+++ b/tests/gdimageclone/CMakeLists.txt
53@@ -1,5 +1,6 @@
54 LIST(APPEND TESTS_FILES
55 bug00300
56+ style
57 )
58
59 ADD_GD_TESTS()
60diff --git a/tests/gdimageclone/Makemodule.am b/tests/gdimageclone/Makemodule.am
61index 4b1b54c..51abf5c 100644
62--- a/tests/gdimageclone/Makemodule.am
63+++ b/tests/gdimageclone/Makemodule.am
64@@ -1,5 +1,6 @@
65 libgd_test_programs += \
66- gdimageclone/bug00300
67+ gdimageclone/bug00300 \
68+ gdimageclone/style
69
70 EXTRA_DIST += \
71 gdimageclone/CMakeLists.txt
72diff --git a/tests/gdimageclone/style.c b/tests/gdimageclone/style.c
73new file mode 100644
74index 0000000..c2b246e
75--- /dev/null
76+++ b/tests/gdimageclone/style.c
77@@ -0,0 +1,30 @@
78+/**
79+ * Cloning an image should exactly reproduce all style related data
80+ */
81+
82+
83+#include <string.h>
84+#include "gd.h"
85+#include "gdtest.h"
86+
87+
88+int main()
89+{
90+ gdImagePtr im, clone;
91+ int style[] = {0, 0, 0};
92+
93+ im = gdImageCreate(8, 8);
94+ gdImageSetStyle(im, style, sizeof(style)/sizeof(style[0]));
95+
96+ clone = gdImageClone(im);
97+ gdTestAssert(clone != NULL);
98+
99+ gdTestAssert(clone->styleLength == im->styleLength);
100+ gdTestAssert(clone->stylePos == im->stylePos);
101+ gdTestAssert(!memcmp(clone->style, im->style, sizeof(style)/sizeof(style[0])));
102+
103+ gdImageDestroy(clone);
104+ gdImageDestroy(im);
105+
106+ return gdNumFailures();
107+}
108--
1092.20.1
110