summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-11-18 11:31:25 +0100
committerAnuj Mittal <anuj.mittal@oss.qualcomm.com>2025-11-19 08:46:56 +0530
commitdbc98a00ebec988d44ad4fddeec3db8370ce9f9d (patch)
tree630d7698af40b0eac8da999ce0f6045a2abd15b4 /meta-oe/recipes-extended
parent786bad80979d0f9f5830e980459de56b5d92fce9 (diff)
downloadmeta-openembedded-dbc98a00ebec988d44ad4fddeec3db8370ce9f9d.tar.gz
libwmf: patch CVE-2015-0848 and CVE-2015-4588
Details: https://nvd.nist.gov/vuln/detail/CVE-2015-0848 https://nvd.nist.gov/vuln/detail/CVE-2015-4588 Pick the commit that mentions the CVE IDs explicitly. The same patch fixes both vulnerabilities. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r--meta-oe/recipes-extended/libwmf/libwmf/CVE-2015-0848-CVE-2015-4588.patch135
-rw-r--r--meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb3
2 files changed, 137 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/libwmf/libwmf/CVE-2015-0848-CVE-2015-4588.patch b/meta-oe/recipes-extended/libwmf/libwmf/CVE-2015-0848-CVE-2015-4588.patch
new file mode 100644
index 0000000000..b65610aa88
--- /dev/null
+++ b/meta-oe/recipes-extended/libwmf/libwmf/CVE-2015-0848-CVE-2015-4588.patch
@@ -0,0 +1,135 @@
1From f42e4f4505b07278f4baccddfc1f47059ae4f931 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
3Date: Wed, 8 Aug 2018 13:59:18 +0100
4Subject: [PATCH] CVE-2015-0848+CVE-2015-4588
5
6CVE: CVE-2015-0848 CVE-2015-4588
7Upstream-Status: Backport [https://github.com/caolanm/libwmf/commit/879d6bffa6dd21b8c0e9ec3b5aa31b6ae090ef83]
8Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
9---
10 src/ipa/ipa.h | 2 +-
11 src/ipa/ipa/bmp.h | 38 +++++++++++++++++++++++++++++++-------
12 2 files changed, 32 insertions(+), 8 deletions(-)
13
14diff --git a/src/ipa/ipa.h b/src/ipa/ipa.h
15index d050a7e..3003540 100644
16--- a/src/ipa/ipa.h
17+++ b/src/ipa/ipa.h
18@@ -48,7 +48,7 @@ static int ReadBlobByte (BMPSource*);
19 static unsigned short ReadBlobLSBShort (BMPSource*);
20 static unsigned long ReadBlobLSBLong (BMPSource*);
21 static long TellBlob (BMPSource*);
22-static void DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*);
23+static int DecodeImage (wmfAPI*,wmfBMP*,BMPSource*,unsigned int,unsigned char*);
24 static void ReadBMPImage (wmfAPI*,wmfBMP*,BMPSource*);
25 static int ExtractColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned int,unsigned int);
26 static void SetColor (wmfAPI*,wmfBMP*,wmfRGB*,unsigned char,unsigned int,unsigned int);
27diff --git a/src/ipa/ipa/bmp.h b/src/ipa/ipa/bmp.h
28index 29eee34..7751a36 100644
29--- a/src/ipa/ipa/bmp.h
30+++ b/src/ipa/ipa/bmp.h
31@@ -859,7 +859,7 @@ static long TellBlob (BMPSource* src)
32 %
33 %
34 */
35-static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels)
36+static int DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int compression,unsigned char* pixels)
37 { int byte;
38 int count;
39 int i;
40@@ -870,12 +870,14 @@ static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int com
41 U32 u;
42
43 unsigned char* q;
44+ unsigned char* end;
45
46 for (u = 0; u < ((U32) bmp->width * (U32) bmp->height); u++) pixels[u] = 0;
47
48 byte = 0;
49 x = 0;
50 q = pixels;
51+ end = pixels + bmp->width * bmp->height;
52
53 for (y = 0; y < bmp->height; )
54 { count = ReadBlobByte (src);
55@@ -884,7 +886,10 @@ static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int com
56 { /* Encoded mode. */
57 byte = ReadBlobByte (src);
58 for (i = 0; i < count; i++)
59- { if (compression == 1)
60+ {
61+ if (q == end)
62+ return 0;
63+ if (compression == 1)
64 { (*(q++)) = (unsigned char) byte;
65 }
66 else
67@@ -896,13 +901,15 @@ static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int com
68 else
69 { /* Escape mode. */
70 count = ReadBlobByte (src);
71- if (count == 0x01) return;
72+ if (count == 0x01) return 1;
73 switch (count)
74 {
75 case 0x00:
76 { /* End of line. */
77 x = 0;
78 y++;
79+ if (y >= bmp->height)
80+ return 0;
81 q = pixels + y * bmp->width;
82 break;
83 }
84@@ -910,13 +917,20 @@ static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int com
85 { /* Delta mode. */
86 x += ReadBlobByte (src);
87 y += ReadBlobByte (src);
88+ if (y >= bmp->height)
89+ return 0;
90+ if (x >= bmp->width)
91+ return 0;
92 q = pixels + y * bmp->width + x;
93 break;
94 }
95 default:
96 { /* Absolute mode. */
97 for (i = 0; i < count; i++)
98- { if (compression == 1)
99+ {
100+ if (q == end)
101+ return 0;
102+ if (compression == 1)
103 { (*(q++)) = ReadBlobByte (src);
104 }
105 else
106@@ -943,7 +957,7 @@ static void DecodeImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src,unsigned int com
107 byte = ReadBlobByte (src); /* end of line */
108 byte = ReadBlobByte (src);
109
110- return;
111+ return 1;
112 }
113
114 /*
115@@ -1143,8 +1157,18 @@ static void ReadBMPImage (wmfAPI* API,wmfBMP* bmp,BMPSource* src)
116 }
117 }
118 else
119- { /* Convert run-length encoded raster pixels. */
120- DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image);
121+ {
122+ if (bmp_info.bits_per_pixel == 8) /* Convert run-length encoded raster pixels. */
123+ {
124+ if (!DecodeImage (API,bmp,src,(unsigned int) bmp_info.compression,data->image))
125+ { WMF_ERROR (API,"corrupt bmp");
126+ API->err = wmf_E_BadFormat;
127+ }
128+ }
129+ else
130+ { WMF_ERROR (API,"Unexpected pixel depth");
131+ API->err = wmf_E_BadFormat;
132+ }
133 }
134
135 if (ERR (API))
diff --git a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
index 93b58057ce..bea9ed6dc8 100644
--- a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
+++ b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
@@ -19,7 +19,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/wvware/${BPN}/${PV}/${BPN}-${PV}.tar.gz;name=ta
19 file://libwmf-0.2.8.4-intoverflow.patch \ 19 file://libwmf-0.2.8.4-intoverflow.patch \
20 file://libwmf-0.2.8.4-useafterfree.patch \ 20 file://libwmf-0.2.8.4-useafterfree.patch \
21 file://0001-configure-use-pkg-config-for-freetype.patch \ 21 file://0001-configure-use-pkg-config-for-freetype.patch \
22 " 22 file://CVE-2015-0848-CVE-2015-4588.patch \
23 "
23 24
24SRC_URI[tarball.md5sum] = "d1177739bf1ceb07f57421f0cee191e0" 25SRC_URI[tarball.md5sum] = "d1177739bf1ceb07f57421f0cee191e0"
25SRC_URI[tarball.sha256sum] = "5b345c69220545d003ad52bfd035d5d6f4f075e65204114a9e875e84895a7cf8" 26SRC_URI[tarball.sha256sum] = "5b345c69220545d003ad52bfd035d5d6f4f075e65204114a9e875e84895a7cf8"