mirror of
https://github.com/apache/httpd.git
synced 2026-10-23 22:49:01 +03:00
mod_substitute: fix heap over-read in set_pattern() delimiter scanning
* 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
This commit is contained in:
2
changes-entries/substitute-pattern-oob-read.txt
Normal file
2
changes-entries/substitute-pattern-oob-read.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
*) mod_substitute: Fix crash or misbehaviour when loading a Substitute
|
||||
directive with a missing closing delimiter. [Joe Orton]
|
||||
@@ -679,7 +679,7 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line)
|
||||
if (delim)
|
||||
from = ++ourline;
|
||||
if (from) {
|
||||
if (*ourline != delim) {
|
||||
if (*ourline && *ourline != delim) {
|
||||
while (*++ourline && *ourline != delim);
|
||||
}
|
||||
if (*ourline) {
|
||||
@@ -688,7 +688,7 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line)
|
||||
}
|
||||
}
|
||||
if (to) {
|
||||
if (*ourline != delim) {
|
||||
if (*ourline && *ourline != delim) {
|
||||
while (*++ourline && *ourline != delim);
|
||||
}
|
||||
if (*ourline) {
|
||||
|
||||
Reference in New Issue
Block a user