From 35965285d58d4511f4fe4bd76ade37d446978a58 Mon Sep 17 00:00:00 2001 From: dongyuzhen Date: Mon, 16 May 2022 20:15:32 +0800 Subject: [PATCH] fix CVE-2022-1122 --- backport-CVE-2022-1122.patch | 29 +++++++++++++++++++++++++++++ openjpeg2.spec | 8 ++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 backport-CVE-2022-1122.patch diff --git a/backport-CVE-2022-1122.patch b/backport-CVE-2022-1122.patch new file mode 100644 index 0000000..90dfa0d --- /dev/null +++ b/backport-CVE-2022-1122.patch @@ -0,0 +1,29 @@ +From 0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d Mon Sep 17 00:00:00 2001 +From: xiaoxiaoafeifei +Date: Wed, 14 Jul 2021 09:35:13 +0800 +Subject: [PATCH] Fix segfault in src/bin/jp2/opj_decompress.c due to + uninitialized pointer (fixes #1368) (#1369) + +Conflict:NA +Reference:https://github.com/uclouvain/openjpeg/commit/0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d + +--- + src/bin/jp2/opj_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c +index cdc543a..f32e702 100644 +--- a/src/bin/jp2/opj_decompress.c ++++ b/src/bin/jp2/opj_decompress.c +@@ -1351,7 +1351,7 @@ int main(int argc, char **argv) + int it_image; + num_images = get_num_images(img_fol.imgdirpath); + +- dirptr = (dircnt_t*)malloc(sizeof(dircnt_t)); ++ dirptr = (dircnt_t*)calloc(1, sizeof(dircnt_t)); + if (!dirptr) { + destroy_parameters(¶meters); + return EXIT_FAILURE; +-- +2.27.0 + diff --git a/openjpeg2.spec b/openjpeg2.spec index f678d78..f2b41af 100644 --- a/openjpeg2.spec +++ b/openjpeg2.spec @@ -1,6 +1,6 @@ Name: openjpeg2 Version: 2.3.1 -Release: 10 +Release: 11 Summary: C-Library for JPEG 2000 License: BSD and MIT URL: https://github.com/uclouvain/openjpeg @@ -25,7 +25,8 @@ Patch6013: backport-CVE-2020-27842.patch Patch6014: backport-0001-CVE-2019-12973.patch Patch6015: backport-0002-CVE-2019-12973.patch Patch6016: backport-CVE-2021-3575.patch - +Patch6017: backport-CVE-2022-1122.patch + BuildRequires: cmake gcc-c++ make zlib-devel libpng-devel libtiff-devel lcms2-devel doxygen Provides: %{name}-tools @@ -101,6 +102,9 @@ mv %{buildroot}%{_mandir}/man1/opj_dump.1 %{buildroot}%{_mandir}/man1/opj2_dump. %{_mandir}/man3/*.3* %changelog +* Mon May 16 2022 dongyuzhen - 2.3.1-11 +- fix CVE-2022-1122 + * Tue Apr 12 2022 dongyuzhen - 2.3.1-10 - fix the issue of opj2_compress/opj2_decompress don't work with png/tiff images -- Gitee