<div dir="ltr">This patch has been applied in several Linux distributions<br><br>Signed-off-by: Jate Sujjavanich &lt;<a href="mailto:jatedev@gmail.com">jatedev@gmail.com</a>&gt;<br>---<br> .../zip/zip-3.0/zipnote-crashes-with-segfault.patch  | 20 ++++++++++++++++++++<br> meta/recipes-extended/zip/<a href="http://zip_3.0.bb">zip_3.0.bb</a>                 |  1 +<br> 2 files changed, 21 insertions(+)<br> create mode 100644 meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch<br><br>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<br>new file mode 100644<br>index 0000000..aa10add<br>--- /dev/null<br>+++ b/meta/recipes-extended/zip/zip-3.0/zipnote-crashes-with-segfault.patch<br>@@ -0,0 +1,20 @@<br>+Close the correct file descriptor<br>+<br>+<a href="https://bugs.archlinux.org/task/47713">https://bugs.archlinux.org/task/47713</a><br>+<br>+Upstream-Status: Pending<br>+<br>+diff --git a/zipnote.c b/zipnote.c<br>+index 5e02cb6..996f012 100644<br>+--- a/zipnote.c<br>++++ b/zipnote.c<br>+@@ -661,7 +661,7 @@ char **argv;            /* command line tokens */<br>+     if ((r = zipcopy(z)) != ZE_OK)<br>+       ziperr(r, &quot;was copying an entry&quot;);<br>+   }<br>+-  fclose(x);<br>++  fclose(in_file);<br>+ <br>+   /* Write central directory and end of central directory with new comments */<br>+   if ((c = zftello(y)) == (zoff_t)-1)    /* get start of central */<br>+   <br>diff --git a/meta/recipes-extended/zip/<a href="http://zip_3.0.bb">zip_3.0.bb</a> b/meta/recipes-extended/zip/<a href="http://zip_3.0.bb">zip_3.0.bb</a><br>index a2cd771..c00a932 100644<br>--- a/meta/recipes-extended/zip/<a href="http://zip_3.0.bb">zip_3.0.bb</a><br>+++ b/meta/recipes-extended/zip/<a href="http://zip_3.0.bb">zip_3.0.bb</a><br>@@ -12,6 +12,7 @@ S = &quot;${WORKDIR}/zip30&quot;<br> SRC_URI = &quot;${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \<br>            file://fix-security-format.patch \<br>            file://10-remove-build-date.patch \<br>+           file://zipnote-crashes-with-segfault.patch \<br>            &quot;<br> UPSTREAM_VERSION_UNKNOWN = &quot;1&quot;<br> <br>-- <br>2.7.4<br><br></div>