From d9bd668f6ee82b8f5f3c829ca06d7d07fcca284e Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 13 Oct 2024 17:26:25 +0300 Subject: [PATCH] tpws,nfqws: fix 100% cpu hang on gzipped hostlist with comments --- nfq/hostlist.c | 40 +++++++++++++++++++++++----------------- nfq/hostlist.h | 2 +- tpws/hostlist.c | 40 +++++++++++++++++++++++----------------- tpws/hostlist.h | 2 +- 4 files changed, 48 insertions(+), 36 deletions(-) diff --git a/nfq/hostlist.c b/nfq/hostlist.c index 03ed441..abb415b 100644 --- a/nfq/hostlist.c +++ b/nfq/hostlist.c @@ -4,17 +4,27 @@ #include "helpers.h" // inplace tolower() and add to pool -static bool addpool(strpool **hostlist, char **s, const char *end) +static bool addpool(strpool **hostlist, char **s, const char *end, int *ct) { - char *p; - - // advance until eol lowering all chars - for (p = *s; p