diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-12-22 10:49:16 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-12-22 10:49:14 +0100 |
commit | 8f28ae94f63a68d059dfb19062e85620fdfe3aa7 (patch) | |
tree | 4799066086a671ecff27d8f0d9ba9bd06143c687 /main/pcre2 | |
parent | 9e403a5e2130be6e53059740d309927be12329f6 (diff) | |
download | aports-8f28ae94f63a68d059dfb19062e85620fdfe3aa7.tar.bz2 aports-8f28ae94f63a68d059dfb19062e85620fdfe3aa7.tar.xz |
main/pcre2: fix bug causing rspamd segfault
Fixes #11061
Diffstat (limited to 'main/pcre2')
-rw-r--r-- | main/pcre2/APKBUILD | 9 | ||||
-rw-r--r-- | main/pcre2/fix-rspamd-segfault.patch | 34 |
2 files changed, 40 insertions, 3 deletions
diff --git a/main/pcre2/APKBUILD b/main/pcre2/APKBUILD index b468415008..e317d3702f 100644 --- a/main/pcre2/APKBUILD +++ b/main/pcre2/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=pcre2 pkgver=10.34 -pkgrel=0 +pkgrel=1 pkgdesc="Perl-compatible regular expression library" url="https://pcre.org/" arch="all" @@ -11,7 +11,9 @@ depends_dev="libedit-dev zlib-dev" makedepends="$depends_dev paxmark" subpackages="$pkgname-dev $pkgname-doc $pkgname-tools libpcre2-16:_libpcre libpcre2-32:_libpcre" -source="https://ftp.pcre.org/pub/pcre/pcre2-$pkgver.tar.gz" +source="https://ftp.pcre.org/pub/pcre/pcre2-$pkgver.tar.gz + fix-rspamd-segfault.patch + " case "$CARCH" in s390x|armhf) _enable_jit="";; # https://bugs.exim.org/show_bug.cgi?id=2468 @@ -80,4 +82,5 @@ tools() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } -sha512sums="820b3805fc7fcf3a80dfd42ff570efc8518fe3c50f3feb720319b95316619e5b8f6601b3c9522606315aecd5558ccfc8a04a89fab9921fdfc3400dc2caf17c22 pcre2-10.34.tar.gz" +sha512sums="820b3805fc7fcf3a80dfd42ff570efc8518fe3c50f3feb720319b95316619e5b8f6601b3c9522606315aecd5558ccfc8a04a89fab9921fdfc3400dc2caf17c22 pcre2-10.34.tar.gz +571e89a3dc74a3e6b52fe9c8083df79a72a6430849a7ffe887fed832c8d40537554ac8ee29c42b3c1f212ad13f0326b9c5d9305d0dd889be10ed25b1cc6992b6 fix-rspamd-segfault.patch" diff --git a/main/pcre2/fix-rspamd-segfault.patch b/main/pcre2/fix-rspamd-segfault.patch new file mode 100644 index 0000000000..e4bd828fab --- /dev/null +++ b/main/pcre2/fix-rspamd-segfault.patch @@ -0,0 +1,34 @@ +From: zherczeg +Date: Sat, 7 Dec 2019 16:00:53 +0000 +Subject: [PATCH] Fix the too early access of the fields of a compiled pattern in JIT + +Patch-Source: https://lists.exim.org/lurker/message/20191207.160053.4a30f0bc.hu.html + +diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c +index f564127..304c47a 100644 +--- a/src/pcre2_jit_compile.c ++++ b/src/pcre2_jit_compile.c +@@ -13742,11 +13742,6 @@ pcre2_jit_compile(pcre2_code *code, uint32_t options) + { + pcre2_real_code *re = (pcre2_real_code *)code; + +-#ifdef SUPPORT_JIT +-executable_functions *functions = (executable_functions *)re->executable_jit; +-static int executable_allocator_is_working = 0; +-#endif +- + if (code == NULL) + return PCRE2_ERROR_NULL; + +@@ -13779,6 +13774,11 @@ actions are needed: + avoid compiler warnings. + */ + ++#ifdef SUPPORT_JIT ++executable_functions *functions = (executable_functions *)re->executable_jit; ++static int executable_allocator_is_working = 0; ++#endif ++ + if ((options & PCRE2_JIT_INVALID_UTF) != 0) + { + if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0) |