Skip to content

core: Fix ap_varbuf_regsub() crash on an empty result - #806

Open
arturobernalg wants to merge 1 commit into
apache:trunkfrom
arturobernalg:fix/httpd-70012-substitute-empty-replacement
Open

arturobernalg wants to merge 1 commit into
apache:trunkfrom
arturobernalg:fix/httpd-70012-substitute-empty-replacement

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Oct 8, 2026 •

Copy link
Copy Markdown
Member
  • server/util.c (regsub_core): Do not terminate the result when nothing is added and the varbuf has no buffer yet; vb->buf is then the shared read-only empty string. This crashed mod_substitute when a regular expression rule replaced a whole line with an empty string.

  • test/modules/filters/test_004_substitute_empty.py: New test.

PR: 70012

* server/util.c (regsub_core): Do not terminate the result when nothing
  is added and the varbuf has no buffer yet; vb->buf is then the shared
  read-only empty string.  This crashed mod_substitute when a regular
  expression rule replaced a whole line with an empty string.

* test/modules/filters/test_004_substitute_empty.py: New test.

PR: 70012
@arturobernalg
arturobernalg force-pushed the fix/httpd-70012-substitute-empty-replacement branch from 49f9d1b to 5c82109 Compare October 8, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant