<pre style='margin:0'>
Jeremy Huddleston Sequoia (jeremyhu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/bc289fc24abedc1f4147ccf3aafbf98f372109cc">https://github.com/macports/macports-ports/commit/bc289fc24abedc1f4147ccf3aafbf98f372109cc</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit bc289fc24abedc1f4147ccf3aafbf98f372109cc
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Thu Jun 22 15:27:29 2017 -0700
<span style='display:block; white-space:pre;color:#404040;'> gzip: Better fix for crash on High Sierra due to usage of %n in dynamic format strings
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
</span>---
archivers/gzip/Portfile | 19 +++----------------
archivers/gzip/files/secure_snprintf.patch | 15 +++++++++++++++
2 files changed, 18 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/gzip/Portfile b/archivers/gzip/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index cc46137..1003080 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/archivers/gzip/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/gzip/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2,7 +2,7 @@ PortSystem 1.0
</span>
name gzip
version 1.8
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span> categories archivers
license GPL-3+
installs_libs no
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,24 +26,11 @@ depends_build port:texinfo
</span>
installs_libs no
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles secure_snprintf.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> configure.args --disable-silent-rules \
DEFS=NO_ASM
<span style='display:block; white-space:pre;background:#ffe0e0;'>-post-patch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # This is a reinplace hack simply because I am unable to look a the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # current (GPLv3) source to come up with a proper fix. This hack was
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # derived by looking at the last GPLv2 version and making a guess that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # this workaround would be successful. If someone able to look at GPLv3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # code wants to come up with a proper fix, note that the solution is to
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # not pass %n in dynamic strings to snprintf (rather than completely
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # disabling it). There is likely some code to control that already
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # since multiple Libcs (including glibc) disallow the usage of %n in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # dynamic strings.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- reinplace "/define USE_SNPRINTF/s/USE_SNPRINTF.*$/USE_SNPRINTF 0/" \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ${worksrcpath}/lib/vasnprintf.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> post-destroot {
set docdir ${prefix}/share/doc/${name}
xinstall -d ${destroot}${docdir}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/archivers/gzip/files/secure_snprintf.patch b/archivers/gzip/files/secure_snprintf.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..0dff749
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/archivers/gzip/files/secure_snprintf.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,15 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+With format string strictness, High Sierra also enforces that %n isn't used
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+in dynamic format strings, but we should just disable its use on darwin in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+general.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib/vasnprintf.c.orig 2017-06-22 15:19:15.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *fbp = dp->conversion;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if USE_SNPRINTF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fbp[1] = '%';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fbp[2] = 'n';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fbp[3] = '\0';
</span></pre><pre style='margin:0'>
</pre>