Skip to content

Commit 029fded

Browse files
author
Marc Stern
committed
useless (and now incorrect) check
1 parent 31dae62 commit 029fded

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

apache2/re_actions.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,9 @@ int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t
283283
}
284284
} while (p != NULL && *next_text_start);
285285

286-
/* If there's more than one member of the array that
287-
* means there was at least one macro present. Combine
288-
* text parts into a single string now.
286+
/* Combine text parts into a single string now.
287+
* If no macro was present, we already returned
289288
*/
290-
if (arr->nelts > 1) {
291289
/* Figure out the required size for the string. */
292290
var->value_len = 0;
293291
for(i = 0; i < arr->nelts; i++) {
@@ -307,7 +305,6 @@ int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t
307305
offset += part->value_len;
308306
}
309307
var->value[offset] = '\0';
310-
}
311308

312309
return 1;
313310
}

0 commit comments

Comments
 (0)