Fix a bunch of cases where the return code of the regex compiler

was not checked properly. This affects: mod_setenvif, mod_usertrack,
mod_proxy, mod_proxy_ftp and core.

PR: 28218


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
André Malo
2004-04-10 13:57:39 +00:00
parent ae295b1555
commit c7031febd3
6 changed files with 35 additions and 4 deletions

View File

@ -1651,9 +1651,15 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg)
if (!cmd->path)
return "<Directory ~ > block must specify a path";
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
if (!r) {
return "Regex could not be compiled";
}
}
else if (thiscmd->cmd_data) { /* <DirectoryMatch> */
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
if (!r) {
return "Regex could not be compiled";
}
}
else if (!strcmp(cmd->path, "/") == 0)
{
@ -1735,10 +1741,16 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
if (thiscmd->cmd_data) { /* <LocationMatch> */
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
if (!r) {
return "Regex could not be compiled";
}
}
else if (!strcmp(cmd->path, "~")) {
cmd->path = ap_getword_conf(cmd->pool, &arg);
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
if (!r) {
return "Regex could not be compiled";
}
}
/* initialize our config and fetch it */
@ -1797,10 +1809,16 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg)
if (thiscmd->cmd_data) { /* <FilesMatch> */
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
if (!r) {
return "Regex could not be compiled";
}
}
else if (!strcmp(cmd->path, "~")) {
cmd->path = ap_getword_conf(cmd->pool, &arg);
r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
if (!r) {
return "Regex could not be compiled";
}
}
else {
char *newpath;