Files
ARTEX/traffic/hookvm
Leo Camus aeae808faf fix(hookvm): charge a ReplaceAll result before building it
strings.ReplaceAll, bytes.ReplaceAll and regexp.ReplaceAllString built
their result and only then charged its length against the memory budget.
A hook that replaces each byte of a 1 MiB string with another 1 MiB
string makes the runtime ask for 1 TiB, and the server exits with
"fatal error: runtime: out of memory" before the limit is checked.

The length of the result is now computed from the match count and
charged first. For a regexp template, each match is bounded by the
template with every $ reference expanded to the whole match.
2026-11-24 23:21:32 +00:00
..