[v6] zip: Add patch fixing zipnote segfault

Submitted by Jate S on Jan. 7, 2020, 3:36 a.m. | Patch ID: 168639

Details

Message ID 20200107033610.95939-1-jatedev@gmail.com
State Accepted
Commit 8e662fced80c98c5495d49c905cc0008cb812589
Headers show

Commit Message

Jate S Jan. 7, 2020, 3:36 a.m.
This patch has been applied in several Linux distributions

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
---
 .../zipnote-crashes-with-segfault.patch       | 22 +++++++++++++++++++
 meta/recipes-extended/zip/zip_3.0.bb          |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch

Patch hide | download patch | download mbox

diff --git a/meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch b/meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch
new file mode 100644
index 0000000000..ce6caff83e
--- /dev/null
+++ b/meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch
@@ -0,0 +1,22 @@ 
+Close the correct file descriptor
+
+https://bugs.archlinux.org/task/47713
+
+Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
+
+Upstream-Status: Inappropriate [no upstream]
+
+diff --git a/zipnote.c b/zipnote.c
+index 5e02cb6..996f012 100644
+--- a/zipnote.c
++++ b/zipnote.c
+@@ -661,7 +661,7 @@ char **argv;            /* command line tokens */
+     if ((r = zipcopy(z)) != ZE_OK)
+       ziperr(r, "was copying an entry");
+   }
+-  fclose(x);
++  fclose(in_file);
+ 
+   /* Write central directory and end of central directory with new comments */
+   if ((c = zftello(y)) == (zoff_t)-1)    /* get start of central */
+   
diff --git a/meta/recipes-extended/zip/zip_3.0.bb b/meta/recipes-extended/zip/zip_3.0.bb
index a2cd7717ca..c00a932763 100644
--- a/meta/recipes-extended/zip/zip_3.0.bb
+++ b/meta/recipes-extended/zip/zip_3.0.bb
@@ -12,6 +12,7 @@  S = "${WORKDIR}/zip30"
 SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \
            file://fix-security-format.patch \
            file://10-remove-build-date.patch \
+           file://zipnote-crashes-with-segfault.patch \
            "
 UPSTREAM_VERSION_UNKNOWN = "1"