summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2025-05-16 10:17:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-19 17:55:17 +0100
commitaf8b70d359edabcf828c2d781345e327dd00b4d6 (patch)
tree2447d7202b80c8e881f32393381d6b1f1ae75ef3
parenta958799d37e59a7ed640e2dddcbe66f4cc19c7e5 (diff)
downloadpoky-af8b70d359edabcf828c2d781345e327dd00b4d6.tar.gz
zip: fix a buffer overflow detected issue
A "buffer overflow detected" issue was observed as follows: | *** buffer overflow detected ***: terminated | | zip error: Interrupted (aborting) This issue is addressed by: https://bugzilla.redhat.com/show_bug.cgi?id=2165653 Port the fix. (From OE-Core rev: e2f3eeaedc0ea896f5f5b23f756056331b1647cf) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/zip/zip-3.0/0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch38
-rw-r--r--meta/recipes-extended/zip/zip_3.0.bb1
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-extended/zip/zip-3.0/0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch b/meta/recipes-extended/zip/zip-3.0/0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch
new file mode 100644
index 0000000000..d760dfcec5
--- /dev/null
+++ b/meta/recipes-extended/zip/zip-3.0/0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch
@@ -0,0 +1,38 @@
1From 23b4ed82bff20c737fe2e95d5b035e92a9522ca2 Mon Sep 17 00:00:00 2001
2From: Ming Liu <liu.ming50@gmail.com>
3Date: Thu, 15 May 2025 13:58:45 +0200
4Subject: [PATCH] fileio.c: fix a buffer overflow detected issue
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Fix a following issue:
10| *** buffer overflow detected ***: terminated
11|
12| zip error: Interrupted (aborting)
13
14Reference: https://bugzilla.redhat.com/show_bug.cgi?id=2165653
15
16Upstream-Status: Inactive-Upstream [the fix is from Redhat but not the official project]
17
18Signed-off-by: Ming Liu <liu.ming50@gmail.com>
19---
20 fileio.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/fileio.c b/fileio.c
24index 1847e62..5a2959d 100644
25--- a/fileio.c
26+++ b/fileio.c
27@@ -3502,7 +3502,7 @@ zwchar *local_to_wide_string(local_string)
28 if ((wc_string = (wchar_t *)malloc((wsize + 1) * sizeof(wchar_t))) == NULL) {
29 ZIPERR(ZE_MEM, "local_to_wide_string");
30 }
31- wsize = mbstowcs(wc_string, local_string, strlen(local_string) + 1);
32+ wsize = mbstowcs(wc_string, local_string, wsize + 1);
33 wc_string[wsize] = (wchar_t) 0;
34
35 /* in case wchar_t is not zwchar */
36--
372.43.0
38
diff --git a/meta/recipes-extended/zip/zip_3.0.bb b/meta/recipes-extended/zip/zip_3.0.bb
index b573669f2f..27691bd89a 100644
--- a/meta/recipes-extended/zip/zip_3.0.bb
+++ b/meta/recipes-extended/zip/zip_3.0.bb
@@ -19,6 +19,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.
19 file://0001-configure-Specify-correct-function-signatures-and-de.patch \ 19 file://0001-configure-Specify-correct-function-signatures-and-de.patch \
20 file://0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch \ 20 file://0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch \
21 file://0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch \ 21 file://0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch \
22 file://0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch \
22 " 23 "
23UPSTREAM_VERSION_UNKNOWN = "1" 24UPSTREAM_VERSION_UNKNOWN = "1"
24 25