summaryrefslogtreecommitdiffstats
path: root/changes-entries
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2024-01-16 18:40:36 +0100
committerYann Ylavic <ylavic@apache.org>2024-01-16 18:40:36 +0100
commit64ecf00d7c1974450bf8780ed1dd3200396745fa (patch)
tree0dadd3b7da03b04081a38c3ea7e304a5c06fbad7 /changes-entries
parentTrigger ci. (diff)
downloadapache2-64ecf00d7c1974450bf8780ed1dd3200396745fa.tar.xz
apache2-64ecf00d7c1974450bf8780ed1dd3200396745fa.zip
mod_headers: Avoid infinite recursion with the edit* action and empty matches.
Change the recursion used for edit* to a loop using the new ap_regexec_ex() function taking the current position (offset) in the subject string. After an empty match do the same thing as pcre2_substitute() (or Perl's /g), that is: don't allow for another empty match at the same positition by setting the AP_REG_NOTEMPTY_ATSTART option. If there is a non-empty match use it, otherwise skip/consume the first character and continue from there. * modules/metadata/mod_headers.c: Rename the hdr_edit_r enum for edit* to hdr_edit_all to better express what is does (and since the action is not recursive anymore). * modules/metadata/mod_headers.c(push_string, push_match): New helpers to consume the subject and substitutions in an array of iovec. * modules/metadata/mod_headers.c(process_regexp): Implement the new logic, using push_match() and push_string() to fill the iovec array finally passed to apr_strcatv() for the resulting string. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915271 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'changes-entries')
-rw-r--r--changes-entries/mod_headers-edit_all.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/changes-entries/mod_headers-edit_all.txt b/changes-entries/mod_headers-edit_all.txt
new file mode 100644
index 0000000000..41136ed56f
--- /dev/null
+++ b/changes-entries/mod_headers-edit_all.txt
@@ -0,0 +1,2 @@
+ *) mod_headers: Fix a possible infinite recursion with the edit* action and
+ empty matches. [Yann Ylavic]