--- /dev/null
+ *) mod_macro: Return an error if the expanded line would exceed the
+ maximum line length. PR 69258.
+ [Marc Stern <marc.stern approach-cyber.com>]
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,