From 99514ca3ba55c8d9919204919f32b55ca2e786c7 Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 25 Sep 2018 20:21:51 +0000 Subject: [PATCH] Always compute (possible) overflow in unsigned math. Avoids crash with clang on startup. Bump revision. --- devel/m4/Makefile | 3 ++- devel/m4/distinfo | 3 ++- devel/m4/patches/patch-lib_xalloc-oversized.h | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 devel/m4/patches/patch-lib_xalloc-oversized.h diff --git a/devel/m4/Makefile b/devel/m4/Makefile index 6d4d68fe257e..c73f0105b20d 100644 --- a/devel/m4/Makefile +++ b/devel/m4/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.75 2017/08/25 05:28:53 adam Exp $ +# $NetBSD: Makefile,v 1.76 2018/09/25 20:21:51 joerg Exp $ DISTNAME= m4-1.4.18 +PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNU:=m4/} diff --git a/devel/m4/distinfo b/devel/m4/distinfo index a61b4b66d9fd..2150f67a6284 100644 --- a/devel/m4/distinfo +++ b/devel/m4/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.43 2018/03/13 20:26:42 jmcneill Exp $ +$NetBSD: distinfo,v 1.44 2018/09/25 20:21:51 joerg Exp $ SHA1 (m4-1.4.18.tar.gz) = 2f76f8105a45b05c8cfede97b3193cd88b31c657 RMD160 (m4-1.4.18.tar.gz) = 16396a6ffbb2105cdd0a36c773b44d16854ed740 @@ -8,3 +8,4 @@ SHA1 (patch-isnan.c) = a960f35e5168bed47c5924e36bfb254dc1a44621 SHA1 (patch-lib_getprogname.c) = 3a8e7c028342ef3a9f86839f1a5ae36571a65f12 SHA1 (patch-lib_stdio.in.h) = 21557ea9d86dbeb36062df4e62cb71735b06480b SHA1 (patch-lib_vasnprintf.c) = 2bced6c121efc9bc5894174c7745ba89e8f53033 +SHA1 (patch-lib_xalloc-oversized.h) = 9e74adec2f43770d419f60d5c3e7bdea2424daa6 diff --git a/devel/m4/patches/patch-lib_xalloc-oversized.h b/devel/m4/patches/patch-lib_xalloc-oversized.h new file mode 100644 index 000000000000..019badd37522 --- /dev/null +++ b/devel/m4/patches/patch-lib_xalloc-oversized.h @@ -0,0 +1,16 @@ +$NetBSD: patch-lib_xalloc-oversized.h,v 1.1 2018/09/25 20:21:51 joerg Exp $ + +--- lib/xalloc-oversized.h.orig 2018-08-19 18:13:08.426109176 +0000 ++++ lib/xalloc-oversized.h +@@ -35,11 +35,7 @@ + #define __xalloc_oversized(n, s) \ + ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n)) + +-#if PTRDIFF_MAX < SIZE_MAX +-typedef ptrdiff_t __xalloc_count_type; +-#else + typedef size_t __xalloc_count_type; +-#endif + + /* Return 1 if an array of N objects, each of size S, cannot exist + reliably due to size or ptrdiff_t arithmetic overflow. S must be