pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel Fix crash on macOS 10.13 (Darwin 7).



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cd05a757be38
branches:  trunk
changeset: 366858:cd05a757be38
user:      adam <adam%pkgsrc.org@localhost>
date:      Fri Aug 18 21:41:19 2017 +0000

description:
Fix crash on macOS 10.13 (Darwin 7).

diffstat:

 devel/bison/distinfo                        |   3 +-
 devel/bison/patches/patch-lib_vasnprintf.c  |  33 +++++++++++++++++++++++++++++
 devel/scmcvs/distinfo                       |   4 +-
 devel/scmcvs/patches/patch-lib_vasnprintf.c |  22 ++++++++++++++-----
 4 files changed, 53 insertions(+), 9 deletions(-)

diffs (112 lines):

diff -r 7be239be81b4 -r cd05a757be38 devel/bison/distinfo
--- a/devel/bison/distinfo      Fri Aug 18 21:08:03 2017 +0000
+++ b/devel/bison/distinfo      Fri Aug 18 21:41:19 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.46 2015/11/03 03:27:16 agc Exp $
+$NetBSD: distinfo,v 1.47 2017/08/18 21:43:03 adam Exp $
 
 SHA1 (bison-3.0.4.tar.xz) = 8270497aad88c7dd4f2c317298c50513fb0c3c8e
 RMD160 (bison-3.0.4.tar.xz) = 414959f3d619d8e4875e241ee02852b2ff13c2cb
@@ -7,3 +7,4 @@
 SHA1 (patch-data_glr.c) = a2e0900ed995e4320e80f8ed05eae8e82be50502
 SHA1 (patch-lib_isnan.c) = 5b44fc6e2e97e36f91cd784bf3a38ad459fccdab
 SHA1 (patch-lib_stdio.in.h) = bb793f0c8f56c3a838609f8a86cf5afc70420da8
+SHA1 (patch-lib_vasnprintf.c) = 2bced6c121efc9bc5894174c7745ba89e8f53033
diff -r 7be239be81b4 -r cd05a757be38 devel/bison/patches/patch-lib_vasnprintf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/bison/patches/patch-lib_vasnprintf.c        Fri Aug 18 21:41:19 2017 +0000
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib_vasnprintf.c,v 1.1 2017/08/18 21:43:03 adam Exp $
+
+Fix crash on macOS 10.13 (Darwin 17).
+http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/vasnprintf.c?id=7df04f9b8a0adb1575ca0555775ec10860143cbf
+
+--- lib/vasnprintf.c.orig      2015-01-04 16:46:03.000000000 +0000
++++ lib/vasnprintf.c
+@@ -4858,7 +4869,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+ #endif
+                   *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \
++         && !defined __UCLIBC__)                                            \
++        || (defined __APPLE__ && defined __MACH__)                          \
++        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+                 fbp[1] = '%';
+                 fbp[2] = 'n';
+                 fbp[3] = '\0';
+@@ -4872,6 +4886,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+                    in format strings in writable memory may crash the program
+                    (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
+                    in this situation.  */
++                /* On Mac OS X 10.3 or newer, we know that snprintf's return
++                   value conforms to ISO C 99: the tests gl_SNPRINTF_RETVAL_C99
++                   and gl_SNPRINTF_TRUNCATION_C99 pass.
++                   Therefore we can avoid using %n in this situation.
++                   On Mac OS X 10.13 or newer, the use of %n in format strings
++                   in writable memory by default crashes the program, so we
++                   should avoid it in this situation.  */
+                 /* On native Windows systems (such as mingw), we can avoid using
+                    %n because:
+                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
diff -r 7be239be81b4 -r cd05a757be38 devel/scmcvs/distinfo
--- a/devel/scmcvs/distinfo     Fri Aug 18 21:08:03 2017 +0000
+++ b/devel/scmcvs/distinfo     Fri Aug 18 21:41:19 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2017/05/12 05:13:43 maya Exp $
+$NetBSD: distinfo,v 1.18 2017/08/18 21:41:19 adam Exp $
 
 SHA1 (cvs-1.12.13.tar.bz2) = 93a8dacc6ff0e723a130835713235863f1f5ada9
 RMD160 (cvs-1.12.13.tar.bz2) = ba3048e3e2d99ae78f6a759889b615acf65dd487
@@ -27,7 +27,7 @@
 SHA1 (patch-ba) = 7153e12e5da86effd4285e147f9f534011982e07
 SHA1 (patch-bb) = 09a607426b672f44c1882b82812e6ca81efdcf8e
 SHA1 (patch-lib_mktime.c) = 526a0e24c6399d527ae6a463ea91e993f9f7e920
-SHA1 (patch-lib_vasnprintf.c) = 6b078c16de6256e33fb86340fe39d663af1b0888
+SHA1 (patch-lib_vasnprintf.c) = fbba4d923d3c61ebcf79e82779919dc1f8a570c0
 SHA1 (patch-m4_fpending.m4) = 6b7c96d8f092e179d2cfdf036bcbfd3855292e0f
 SHA1 (patch-src_error.c) = 60aba581be95aebbb6fb16c888fd384d855fe56e
 SHA1 (patch-src_ignore.c) = 90ac25311c83bb5713b83b9cfb6b2c03790ee787
diff -r 7be239be81b4 -r cd05a757be38 devel/scmcvs/patches/patch-lib_vasnprintf.c
--- a/devel/scmcvs/patches/patch-lib_vasnprintf.c       Fri Aug 18 21:08:03 2017 +0000
+++ b/devel/scmcvs/patches/patch-lib_vasnprintf.c       Fri Aug 18 21:41:19 2017 +0000
@@ -1,16 +1,19 @@
-$NetBSD: patch-lib_vasnprintf.c,v 1.1 2015/04/12 07:43:42 dsainty Exp $
+$NetBSD: patch-lib_vasnprintf.c,v 1.2 2017/08/18 21:41:19 adam Exp $
 
 Avoid CVS crashing on systems using _FORTIFY_SOURCE by default.
-
 http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/vasnprintf.c?id=913c09becd9df89dbd9b9f386e7f35c240d5efe8
 
---- lib/vasnprintf.c.orig      2005-05-24 05:44:33.000000000 +1200
-+++ lib/vasnprintf.c   2015-04-12 18:56:46.352971555 +1200
-@@ -558,9 +558,21 @@
+Fix crash on macOS 10.13 (Darwin 7).
+http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/vasnprintf.c?id=7df04f9b8a0adb1575ca0555775ec10860143cbf
+
+--- lib/vasnprintf.c.orig      2005-05-23 17:44:33.000000000 +0000
++++ lib/vasnprintf.c
+@@ -558,9 +558,29 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l
                  }
                *p = dp->conversion;
  #if USE_SNPRINTF
-+# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
++# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) \
++      || (defined __APPLE__ && defined __MACH__))
                p[1] = '%';
                p[2] = 'n';
                p[3] = '\0';
@@ -23,6 +26,13 @@
 +                 in format strings in writable memory may crash the program
 +                 (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
 +                 in this situation.  */
++              /* On Mac OS X 10.3 or newer, we know that snprintf's return
++                 value conforms to ISO C 99: the tests gl_SNPRINTF_RETVAL_C99
++                 and gl_SNPRINTF_TRUNCATION_C99 pass.
++                 Therefore we can avoid using %n in this situation.
++                 On Mac OS X 10.13 or newer, the use of %n in format strings
++                 in writable memory by default crashes the program, so we
++                 should avoid it in this situation.  */
 +              p[1] = '\0';
 +# endif
  #else



Home | Main Index | Thread Index | Old Index