From 5322f964c8c47a63f18c32152031c06eb0f7f798 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 26 Jun 2019 10:11:20 +0200 Subject: [PATCH] musl: workaround a segfault in dcngettext(). Close #12042 --- srcpkgs/musl/patches/mo_lookup.patch | 19 +++++++++++++++++++ srcpkgs/musl/template | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/musl/patches/mo_lookup.patch diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch new file mode 100644 index 0000000000..c23eaf33bc --- /dev/null +++ b/srcpkgs/musl/patches/mo_lookup.patch @@ -0,0 +1,19 @@ +Do not crash with a NULL pointer dereference when dcngettext() +is called with NULL msgid[12] arguments. + +Fix for https://github.com/void-linux/void-packages/issues/12042 +and probably others. + + --xtraeme + +--- src/locale/__mo_lookup.c.orig 2019-06-26 09:55:36.843012674 +0200 ++++ src/locale/__mo_lookup.c 2019-06-26 09:56:11.529443955 +0200 +@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s + uint32_t b = 0, n = swapc(mo[2], sw); + uint32_t o = swapc(mo[3], sw); + uint32_t t = swapc(mo[4], sw); +- if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4)) ++ if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4)) + return 0; + o/=4; + t/=4; diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template index 8f7ea0c9dc..2a101f922d 100644 --- a/srcpkgs/musl/template +++ b/srcpkgs/musl/template @@ -1,7 +1,7 @@ # Template file for 'musl'. pkgname=musl version=1.1.22 -revision=3 +revision=4 archs="*-musl" build_style=gnu-configure configure_args="--prefix=/usr --disable-gcc-wrapper"