detect/parse: debug validation before stack allocation

A rule size has a global bound

Ticket: 8001
pull/14941/head
Philippe Antoine 5 months ago committed by Victor Julien
parent db64462b1d
commit 4849d34325

@ -1889,6 +1889,7 @@ static int SigParse(DetectEngineCtx *de_ctx, Signature *s, const char *sigstr,
/* we can have no options, so make sure we have them */
if (strlen(parser->opts) > 0) {
size_t buffer_size = strlen(parser->opts) + 1;
DEBUG_VALIDATE_BUG_ON(buffer_size > DETECT_MAX_RULE_SIZE);
char input[buffer_size];
char output[buffer_size];
memset(input, 0x00, buffer_size);

Loading…
Cancel
Save