Avoid last loop and storing an empty value in case nothing after last %{..} macro

This commit is contained in:
Marc Stern
2023-10-26 14:21:32 +02:00
parent e9bf697c00
commit 608cd1d09d

View File

@@ -279,7 +279,7 @@ int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t
part->value_len = strlen(part->value); part->value_len = strlen(part->value);
*(msc_string **)apr_array_push(arr) = part; *(msc_string **)apr_array_push(arr) = part;
} }
} while (p != NULL); } while (p != NULL && *next_text_start);
/* If there's more than one member of the array that /* If there's more than one member of the array that
* means there was at least one macro present. Combine * means there was at least one macro present. Combine