diff options
author | Fabian Groffen <grobian@gentoo.org> | 2024-02-11 21:05:31 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2024-02-11 21:05:31 +0100 |
commit | 2582b32d9016fdda44afd8cbbfbb198584e14c41 (patch) | |
tree | f8e05551379d38ecf4fac1d1ca3916e5aee8e370 /mail-mta | |
parent | dev-python/sqlalchemy: add 2.0.26 (diff) | |
download | gentoo-2582b32d9016fdda44afd8cbbfbb198584e14c41.tar.gz gentoo-2582b32d9016fdda44afd8cbbfbb198584e14c41.tar.bz2 gentoo-2582b32d9016fdda44afd8cbbfbb198584e14c41.zip |
mail-mta/exim-4.97.1-r3: update regex memory patch
Include 84add256b346 from upstream.
Bug: https://bugs.gentoo.org/922780
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'mail-mta')
-rw-r--r-- | mail-mta/exim/exim-4.97.1-r3.ebuild (renamed from mail-mta/exim/exim-4.97.1-r2.ebuild) | 0 | ||||
-rw-r--r-- | mail-mta/exim/files/exim-4.97.1-memory-usage-bug-3047.patch | 35 |
2 files changed, 34 insertions, 1 deletions
diff --git a/mail-mta/exim/exim-4.97.1-r2.ebuild b/mail-mta/exim/exim-4.97.1-r3.ebuild index 8ac924524bb1..8ac924524bb1 100644 --- a/mail-mta/exim/exim-4.97.1-r2.ebuild +++ b/mail-mta/exim/exim-4.97.1-r3.ebuild diff --git a/mail-mta/exim/files/exim-4.97.1-memory-usage-bug-3047.patch b/mail-mta/exim/files/exim-4.97.1-memory-usage-bug-3047.patch index 75e5d1a42781..b8f4eb9c5eef 100644 --- a/mail-mta/exim/files/exim-4.97.1-memory-usage-bug-3047.patch +++ b/mail-mta/exim/files/exim-4.97.1-memory-usage-bug-3047.patch @@ -10,6 +10,11 @@ Date: Fri, 26 Jan 2024 21:58:59 +0000 Subject: [PATCH] ACL: in "regex" condition, release store every thousand lines. Bug 3047 +From: Jeremy Harris <jgh146exb@wizmail.org> +Date: Sun, 11 Feb 2024 13:57:18 +0000 (+0000) +Subject: Use non-releaseable memory for regex match strings. Bug 3047 +Broken-by: 35aacb69f5c8 + diff --git a/src/src/exim.c b/src/src/exim.c --- a/src/exim.c @@ -110,7 +115,7 @@ diff --git a/src/src/regex.c b/src/src/regex.c /* precompile our regexes */ while ((regex_string = string_nextinlist(&list, &sep, NULL, 0))) -@@ -58,7 +57,9 @@ while ((regex_string = string_nextinlist(&list, &sep, NULL, 0))) +@@ -58,10 +57,19 @@ while ((regex_string = string_nextinlist(&list, &sep, NULL, 0))) ri->pcre_text = regex_string; ri->next = re_list_head; re_list_head = ri; @@ -120,6 +125,34 @@ diff --git a/src/src/regex.c b/src/src/regex.c return re_list_head; } ++ ++/* Check list of REs against buffer, returning OK for (first) match, ++else FAIL. On match return allocated result strings in regex_vars[]. ++ ++We use the perm-pool for that, so that our caller can release ++other allocations. ++*/ + static int + matcher(pcre_list * re_list_head, uschar * linebuffer, int len) + { +@@ -75,6 +82,9 @@ for (pcre_list * ri = re_list_head; ri; ri = ri->next) + /* try matcher on the line */ + if ((n = pcre2_match(ri->re, (PCRE2_SPTR)linebuffer, len, 0, 0, md, pcre_gen_mtc_ctx)) > 0) + { ++ int save_pool = store_pool; ++ store_pool = POOL_PERM; ++ + Ustrncpy(regex_match_string_buffer, ri->pcre_text, + sizeof(regex_match_string_buffer)-1); + regex_match_string = regex_match_string_buffer; +@@ -87,6 +97,7 @@ for (pcre_list * ri = re_list_head; ri; ri = ri->next) + regex_vars[nn-1] = string_copyn(linebuffer + ovec[off], len); + } + ++ store_pool = save_pool; + return OK; + } + } @@ -112,7 +113,8 @@ FILE * mbox_file; pcre_list * re_list_head; uschar * linebuffer; |