diff options
author | Sakib Sajal <sakib.sajal@windriver.com> | 2021-08-26 11:07:26 -0400 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-08-26 19:18:35 -0700 |
commit | 5741b949a875b07335d4920aefa6defd13ed45c6 (patch) | |
tree | 55797c4bc64f8c78ebe7e6b463ffd433bca12236 | |
parent | 14958cdad1a9ea1f33949d5d35106a022df3aa64 (diff) | |
download | meta-openembedded-5741b949a875b07335d4920aefa6defd13ed45c6.tar.gz |
gd: fix CVE-2021-38115
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/gd/gd/0001-fix-read-out-of-bands-in-reading-tga-header-file.patch | 33 | ||||
-rw-r--r-- | meta-oe/recipes-support/gd/gd_2.3.2.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gd/gd/0001-fix-read-out-of-bands-in-reading-tga-header-file.patch b/meta-oe/recipes-support/gd/gd/0001-fix-read-out-of-bands-in-reading-tga-header-file.patch new file mode 100644 index 0000000000..649b9b744f --- /dev/null +++ b/meta-oe/recipes-support/gd/gd/0001-fix-read-out-of-bands-in-reading-tga-header-file.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 8b111b2b4a4842179be66db68d84dda91a246032 Mon Sep 17 00:00:00 2001 | ||
2 | From: maryam ebrahimzadeh <maryam.ebr@student.sharif.edu> | ||
3 | Date: Mon, 19 Jul 2021 10:07:13 +0430 | ||
4 | Subject: [PATCH] fix read out-of-bands in reading tga header file | ||
5 | |||
6 | CVE: CVE-2021-38115 | ||
7 | Upstream-Status: Backport [8b111b2b4a4842179be66db68d84dda91a246032] | ||
8 | |||
9 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
10 | --- | ||
11 | src/gd_tga.c | 6 +++++- | ||
12 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/gd_tga.c b/src/gd_tga.c | ||
15 | index cae9428..286febb 100644 | ||
16 | --- a/src/gd_tga.c | ||
17 | +++ b/src/gd_tga.c | ||
18 | @@ -191,7 +191,11 @@ int read_header_tga(gdIOCtx *ctx, oTga *tga) | ||
19 | return -1; | ||
20 | } | ||
21 | |||
22 | - gdGetBuf(tga->ident, tga->identsize, ctx); | ||
23 | + | ||
24 | + if (gdGetBuf(tga->ident, tga->identsize, ctx) != tga->identsize) { | ||
25 | + gd_error("fail to read header ident"); | ||
26 | + return -1; | ||
27 | + } | ||
28 | } | ||
29 | |||
30 | return 1; | ||
31 | -- | ||
32 | 2.25.1 | ||
33 | |||
diff --git a/meta-oe/recipes-support/gd/gd_2.3.2.bb b/meta-oe/recipes-support/gd/gd_2.3.2.bb index 37896415ee..557b45dc49 100644 --- a/meta-oe/recipes-support/gd/gd_2.3.2.bb +++ b/meta-oe/recipes-support/gd/gd_2.3.2.bb | |||
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8e5bc8627b9494741c905d65238c66b7" | |||
14 | DEPENDS = "freetype libpng jpeg zlib tiff" | 14 | DEPENDS = "freetype libpng jpeg zlib tiff" |
15 | 15 | ||
16 | SRC_URI = "git://github.com/libgd/libgd.git;branch=master \ | 16 | SRC_URI = "git://github.com/libgd/libgd.git;branch=master \ |
17 | file://0001-fix-read-out-of-bands-in-reading-tga-header-file.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | SRCREV = "2e40f55bfb460fc9d8cbcd290a0c9eb908d5af7e" | 20 | SRCREV = "2e40f55bfb460fc9d8cbcd290a0c9eb908d5af7e" |