* modules/filters/mod_substitute.c (set_pattern): Guard the
pre-incrementing delimiter scan loops with a NUL check, preventing
a read past the end of the allocation when the from or to field has
no closing delimiter.
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: closes #685
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1936264 13f79535-47bb-0310-9956-
ffa450edef68
--- /dev/null
+ *) mod_substitute: Fix crash or misbehaviour when loading a Substitute
+ directive with a missing closing delimiter. [Joe Orton]
if (delim)
from = ++ourline;
if (from) {
- if (*ourline != delim) {
+ if (*ourline && *ourline != delim) {
while (*++ourline && *ourline != delim);
}
if (*ourline) {
}
}
if (to) {
- if (*ourline != delim) {
+ if (*ourline && *ourline != delim) {
while (*++ourline && *ourline != delim);
}
if (*ourline) {