diff options
author | adam <adam@pkgsrc.org> | 2017-08-18 21:41:19 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2017-08-18 21:41:19 +0000 |
commit | ec09876ce2653b72d730e8cb9765b201dadfcb2d (patch) | |
tree | f12efd34229a0f3b7e0a51da1bd9ca0f1569c568 | |
parent | a82b3db6acb7d03528c05e9e4ad57c8da1980f1c (diff) | |
download | pkgsrc-ec09876ce2653b72d730e8cb9765b201dadfcb2d.tar.gz |
Fix crash on macOS 10.13 (Darwin 7).
-rw-r--r-- | devel/bison/distinfo | 3 | ||||
-rw-r--r-- | devel/bison/patches/patch-lib_vasnprintf.c | 33 | ||||
-rw-r--r-- | devel/scmcvs/distinfo | 4 | ||||
-rw-r--r-- | devel/scmcvs/patches/patch-lib_vasnprintf.c | 22 |
4 files changed, 53 insertions, 9 deletions
diff --git a/devel/bison/distinfo b/devel/bison/distinfo index c8a6f4869c1..0e1e5406bec 100644 --- a/devel/bison/distinfo +++ b/devel/bison/distinfo @@ -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 @@ Size (bison-3.0.4.tar.xz) = 1973796 bytes 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 --git a/devel/bison/patches/patch-lib_vasnprintf.c b/devel/bison/patches/patch-lib_vasnprintf.c new file mode 100644 index 00000000000..6fa8c586b72 --- /dev/null +++ b/devel/bison/patches/patch-lib_vasnprintf.c @@ -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 --git a/devel/scmcvs/distinfo b/devel/scmcvs/distinfo index 79843841f0c..7df854eb84d 100644 --- a/devel/scmcvs/distinfo +++ b/devel/scmcvs/distinfo @@ -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-az) = 9dfd460ae6617f1492e0e6861387ff80080a7d5d 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 --git a/devel/scmcvs/patches/patch-lib_vasnprintf.c b/devel/scmcvs/patches/patch-lib_vasnprintf.c index 751c8a96c8a..2ab71b73e81 100644 --- a/devel/scmcvs/patches/patch-lib_vasnprintf.c +++ b/devel/scmcvs/patches/patch-lib_vasnprintf.c @@ -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 @@ http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/vasnprintf.c?id=913c09bec + 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 |