<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/edf0ee1e2cfa884c73089e7ca32e7009f071dbd0">https://github.com/macports/macports-ports/commit/edf0ee1e2cfa884c73089e7ca32e7009f071dbd0</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit edf0ee1e2cfa884c73089e7ca32e7009f071dbd0
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Thu Jun 22 15:28:47 2017 -0700
<span style='display:block; white-space:pre;color:#404040;'> m4: 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>---
devel/m4/Portfile | 19 +++----------------
devel/m4/files/secure_snprintf.patch | 15 +++++++++++++++
2 files changed, 18 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/m4/Portfile b/devel/m4/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 53f6b61..3994d1d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/m4/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/m4/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2,7 +2,7 @@ PortSystem 1.0
</span>
name m4
version 1.4.18
<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 devel
license GPL-3+
installs_libs no
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,26 +25,13 @@ use_bzip2 yes
</span> checksums rmd160 a1675a77cfcb4210d02b3ef0e10df322635a254c \
sha256 6640d76b043bc658139c8903e293d5978309bf0f408107146505eca701e67cf6
<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 --program-prefix=g \
ac_cv_libsigsegv=no
use_parallel_build yes
<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 {
move ${destroot}${prefix}/share/info/m4.info ${destroot}${prefix}/share/info/gm4.info
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/m4/files/secure_snprintf.patch b/devel/m4/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/devel/m4/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>