diff options
Diffstat (limited to 'meta/recipes-extended/zip')
4 files changed, 87 insertions, 40 deletions
diff --git a/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch b/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch new file mode 100644 index 0000000000..0d3af37ded --- /dev/null +++ b/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 9db2f8cdbbc0dfb359d3b4e5dfe48c18652ce531 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 8 May 2024 19:02:46 -0700 | ||
4 | Subject: [PATCH] configure: Include dirent.h for closedir/opendir APIs | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | GCC-14 is strict about function prototypes and since the | ||
10 | testcase tries to compile/link opendir/closedir functions | ||
11 | without including signatures, it fails to build the test | ||
12 | due to missing signatures which come from dirent.h | ||
13 | |||
14 | Therefore include the needed system header and make it more | ||
15 | robust. | ||
16 | |||
17 | Fixes | ||
18 | a.c:2:21: error: implicit declaration of function ‘closedir’ [-Wimplicit-function-declaration] | ||
19 | 2 | int main() { return closedir(opendir(".")); } | ||
20 | | ^~~~~~~~ | ||
21 | a.c:2:30: error: implicit declaration of function ‘opendir’ [-Wimplicit-function-declaration] | ||
22 | 2 | int main() { return closedir(opendir(".")); } | ||
23 | | ^~~~~~~ | ||
24 | |||
25 | Upstream-Status: Inactive-Upstream | ||
26 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
27 | --- | ||
28 | unix/configure | 1 + | ||
29 | 1 file changed, 1 insertion(+) | ||
30 | |||
31 | diff --git a/unix/configure b/unix/configure | ||
32 | index f917086..1dd98c6 100644 | ||
33 | --- a/unix/configure | ||
34 | +++ b/unix/configure | ||
35 | @@ -591,6 +591,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null | ||
36 | |||
37 | echo Check for directory libraries | ||
38 | cat > conftest.c << _EOF_ | ||
39 | +#include <dirent.h> | ||
40 | int main() { return closedir(opendir(".")); } | ||
41 | _EOF_ | ||
42 | |||
43 | -- | ||
44 | 2.45.0 | ||
45 | |||
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 @@ | |||
1 | From 23b4ed82bff20c737fe2e95d5b035e92a9522ca2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ming Liu <liu.ming50@gmail.com> | ||
3 | Date: Thu, 15 May 2025 13:58:45 +0200 | ||
4 | Subject: [PATCH] fileio.c: fix a buffer overflow detected issue | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Fix a following issue: | ||
10 | | *** buffer overflow detected ***: terminated | ||
11 | | | ||
12 | | zip error: Interrupted (aborting) | ||
13 | |||
14 | Reference: https://bugzilla.redhat.com/show_bug.cgi?id=2165653 | ||
15 | |||
16 | Upstream-Status: Inactive-Upstream [the fix is from Redhat but not the official project] | ||
17 | |||
18 | Signed-off-by: Ming Liu <liu.ming50@gmail.com> | ||
19 | --- | ||
20 | fileio.c | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/fileio.c b/fileio.c | ||
24 | index 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 | -- | ||
37 | 2.43.0 | ||
38 | |||
diff --git a/meta/recipes-extended/zip/zip-3.0/0002-unix.c-Do-not-redefine-DIR-as-FILE.patch b/meta/recipes-extended/zip/zip-3.0/0002-unix.c-Do-not-redefine-DIR-as-FILE.patch deleted file mode 100644 index a86e03e620..0000000000 --- a/meta/recipes-extended/zip/zip-3.0/0002-unix.c-Do-not-redefine-DIR-as-FILE.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From 76f5bf3546d826dcbc03acbefcf0b10b972bf136 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 10 Aug 2022 17:19:38 -0700 | ||
4 | Subject: [PATCH 2/2] unix.c: Do not redefine DIR as FILE | ||
5 | |||
6 | DIR is already provided on Linux via | ||
7 | /usr/include/dirent.h system header | ||
8 | |||
9 | Upstream-Status: Inactive-Upstream | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | unix/unix.c | 2 -- | ||
13 | 1 file changed, 2 deletions(-) | ||
14 | |||
15 | diff --git a/unix/unix.c b/unix/unix.c | ||
16 | index ba87614..6e6f4d2 100644 | ||
17 | --- a/unix/unix.c | ||
18 | +++ b/unix/unix.c | ||
19 | @@ -61,13 +61,11 @@ local time_t label_utim = 0; | ||
20 | /* Local functions */ | ||
21 | local char *readd OF((DIR *)); | ||
22 | |||
23 | - | ||
24 | #ifdef NO_DIR /* for AT&T 3B1 */ | ||
25 | #include <sys/dir.h> | ||
26 | #ifndef dirent | ||
27 | # define dirent direct | ||
28 | #endif | ||
29 | -typedef FILE DIR; | ||
30 | /* | ||
31 | ** Apparently originally by Rich Salz. | ||
32 | ** Cleaned up and modified by James W. Birdsall. | ||
33 | -- | ||
34 | 2.37.1 | ||
35 | |||
diff --git a/meta/recipes-extended/zip/zip_3.0.bb b/meta/recipes-extended/zip/zip_3.0.bb index 70df5ab872..d1092551f7 100644 --- a/meta/recipes-extended/zip/zip_3.0.bb +++ b/meta/recipes-extended/zip/zip_3.0.bb | |||
@@ -3,11 +3,10 @@ HOMEPAGE = "http://www.info-zip.org" | |||
3 | DESCRIPTION = "Info-ZIP's purpose is to provide free, portable, high-quality versions of the Zip and UnZip compressor-archiver utilities that are compatible with the DOS-based PKZIP by PKWARE, Inc." | 3 | DESCRIPTION = "Info-ZIP's purpose is to provide free, portable, high-quality versions of the Zip and UnZip compressor-archiver utilities that are compatible with the DOS-based PKZIP by PKWARE, Inc." |
4 | SECTION = "console/utils" | 4 | SECTION = "console/utils" |
5 | 5 | ||
6 | LICENSE = "BSD-3-Clause" | 6 | LICENSE = "Info-ZIP" |
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d" | 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d" |
8 | 8 | ||
9 | 9 | S = "${UNPACKDIR}/zip30" | |
10 | S = "${WORKDIR}/zip30" | ||
11 | 10 | ||
12 | SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \ | 11 | SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \ |
13 | file://fix-security-format.patch \ | 12 | file://fix-security-format.patch \ |
@@ -17,12 +16,12 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar. | |||
17 | file://0002-configure-support-PIC-code-build.patch \ | 16 | file://0002-configure-support-PIC-code-build.patch \ |
18 | file://0001-configure-Use-CFLAGS-and-LDFLAGS-when-doing-link-tes.patch \ | 17 | file://0001-configure-Use-CFLAGS-and-LDFLAGS-when-doing-link-tes.patch \ |
19 | file://0001-configure-Specify-correct-function-signatures-and-de.patch \ | 18 | file://0001-configure-Specify-correct-function-signatures-and-de.patch \ |
20 | file://0002-unix.c-Do-not-redefine-DIR-as-FILE.patch \ | ||
21 | file://0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch \ | 19 | file://0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch \ |
20 | file://0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch \ | ||
21 | file://0001-fileio.c-fix-a-buffer-overflow-detected-issue.patch \ | ||
22 | " | 22 | " |
23 | UPSTREAM_VERSION_UNKNOWN = "1" | 23 | UPSTREAM_VERSION_UNKNOWN = "1" |
24 | 24 | ||
25 | SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37" | ||
26 | SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369" | 25 | SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369" |
27 | 26 | ||
28 | CVE_STATUS[CVE-2018-13410] = "disputed: Disputed and also Debian doesn't consider a vulnerability" | 27 | CVE_STATUS[CVE-2018-13410] = "disputed: Disputed and also Debian doesn't consider a vulnerability" |