<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/b76d1e48dac1f977a456ac134753aba9423f6e56">https://github.com/macports/macports-ports/commit/b76d1e48dac1f977a456ac134753aba9423f6e56</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b76d1e48dac1f977a456ac134753aba9423f6e56
</span>Author: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
AuthorDate: Thu Jun 22 15:25:00 2017 -0700
<span style='display:block; white-space:pre;color:#404040;'> nano: Fix 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>---
editors/nano/Portfile | 4 +++-
editors/nano/files/secure_snprintf.patch | 15 +++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/editors/nano/Portfile b/editors/nano/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 2d274c4..27eeaa2 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/editors/nano/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/editors/nano/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,6 +4,7 @@ PortSystem 1.0
</span>
name nano
version 2.8.4
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span> categories editors
platforms darwin freebsd
license GPL-3
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -28,7 +29,8 @@ depends_lib port:gettext \
</span> port:ncurses \
port:zlib
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles nawk.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles nawk.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secure_snprintf.patch
</span>
configure.args --disable-wrapping-as-root \
--enable-nanorc \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/editors/nano/files/secure_snprintf.patch b/editors/nano/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/editors/nano/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>