]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
ap_regex: PCRE needs buffers sized against the number of captures only.
authorYann Ylavic <ylavic@apache.org>
Thu, 20 Jan 2022 12:16:58 +0000 (12:16 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 20 Jan 2022 12:16:58 +0000 (12:16 +0000)
commit2a59c923685dce9f4d726f45c222df27bbdf1f1f
tree89c12bfbf0e2e9186e8deff1e0711d528435879f
parent702712a43d0a2d671e001e7c0107a79aaaa4fc3c
ap_regex: PCRE needs buffers sized against the number of captures only.

No more (useless), no less (or PCRE will allocate a new buffer by itself to
satisfy the needs), so we should base our buffer size solely on the number
of captures in the regex (determined at compile time from the pattern).

The nmatch provided by the user is used to fill in pmatch only (up to that),
but "our" buffers are sized exactly as needed to avoid oversized allocations
or PCRE allocating by itself.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897244 13f79535-47bb-0310-9956-ffa450edef68
server/util_pcre.c