blob: 8aa9c15e33668aa927a6c430887318809a879604 [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001Upstream-Status: Backport [https://github.com/uclouvain/openjpeg/commit/0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d]
2CVE: CVE-2022-1122
3
4While this patch improves things re-CVE-2022-1122, the defect is undergoing re-analysis and there may be follow-up commits.
5
6From 0afbdcf3e6d0d2bd2e16a0c4d513ee3cf86e460d Mon Sep 17 00:00:00 2001
7From: xiaoxiaoafeifei <lliangliang2007@163.com>
8Date: Wed, 14 Jul 2021 09:35:13 +0800
9Subject: [PATCH] Fix segfault in src/bin/jp2/opj_decompress.c due to
10 uninitialized pointer (fixes #1368) (#1369)
11
12---
13 src/bin/jp2/opj_decompress.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
17index 0e028735..18ead672 100644
18--- a/src/bin/jp2/opj_decompress.c
19+++ b/src/bin/jp2/opj_decompress.c
20@@ -1356,7 +1356,7 @@ int main(int argc, char **argv)
21 int it_image;
22 num_images = get_num_images(img_fol.imgdirpath);
23
24- dirptr = (dircnt_t*)malloc(sizeof(dircnt_t));
25+ dirptr = (dircnt_t*)calloc(1, sizeof(dircnt_t));
26 if (!dirptr) {
27 destroy_parameters(&parameters);
28 return EXIT_FAILURE;
29--
302.25.1
31