summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2024-09-12 10:36:55 +0200
committerJoe Orton <jorton@apache.org>2024-09-12 10:36:55 +0200
commit43721ffceeaa4b373887d423a20984afca96707b (patch)
tree5dd828a30e212bdeedcff467181fb5c33ab498b6 /modules
parentAdd Multipath TCP (MPTCP) support (Proxy) (diff)
downloadapache2-43721ffceeaa4b373887d423a20984afca96707b.tar.xz
apache2-43721ffceeaa4b373887d423a20984afca96707b.zip
* modules/core/mod_macro.c (process_content): Return error if there's
enough not space to store the macro. Replaced MAX_STRING_LEN by sizeof(line). PR: 69258 Submitted by: Marc Stern <marc.stern approach-cyber.com> Github: closes #479 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920588 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/core/mod_macro.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/core/mod_macro.c b/modules/core/mod_macro.c
index 544a287196..24d6330d0d 100644
--- a/modules/core/mod_macro.c
+++ b/modules/core/mod_macro.c
@@ -483,8 +483,13 @@ static const char *process_content(apr_pool_t * pool,
for (i = 0; i < contents->nelts; i++) {
const char *errmsg;
/* copy the line and substitute macro parameters */
- apr_cpystrn(line, ((char **) contents->elts)[i], MAX_STRING_LEN);
- errmsg = substitute_macro_args(line, MAX_STRING_LEN,
+ if (strlen(((char**)contents->elts)[i]) >= sizeof(line)) {
+ return apr_psprintf(pool,
+ "while processing line %d of macro '%s' (%s) %s",
+ i + 1, macro->name, macro->location, "macro too long");
+ }
+ apr_cpystrn(line, ((char **) contents->elts)[i], sizeof(line));
+ errmsg = substitute_macro_args(line, sizeof(line),
macro, replacements, used);
if (errmsg) {
return apr_psprintf(pool,