From ad448da3f454667c96b54d913084761358fe5018 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 25 Apr 2020 14:25:29 +0200 Subject: [PATCH] flowbits: fix hang in flowbits 'or' parsing --- src/detect-flowbits.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index 6066ea04b6..c1dca111d2 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -84,7 +84,7 @@ static int FlowbitOrAddData(DetectEngineCtx *de_ctx, DetectFlowbitsData *cd, cha while(isspace((unsigned char)*token)) token++; if (*token == 0) - continue; + goto next; char *end = token + strlen(token) - 1; while(end > token && isspace((unsigned char)*end)) *(end--) = '\0'; @@ -100,9 +100,9 @@ static int FlowbitOrAddData(DetectEngineCtx *de_ctx, DetectFlowbitsData *cd, cha "maximum allowed: %d.", MAX_TOKENS); return -1; } - strarr[i] = token; + strarr[i++] = token; + next: arrptr = NULL; - i++; } cd->or_list_size = i; -- 2.47.2