From: Victor Julien Date: Sat, 25 Apr 2020 12:25:29 +0000 (+0200) Subject: flowbits: fix hang in flowbits 'or' parsing X-Git-Tag: suricata-6.0.0-beta1~462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad448da3f454667c96b54d913084761358fe5018;p=thirdparty%2Fsuricata.git flowbits: fix hang in flowbits 'or' parsing --- 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;