From f28a3b293e8d103170155bd9137b33a5eddfd6ec Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 19 Feb 2022 19:18:02 +0100 Subject: Fix compilation and sync unit tests results (#1445) 'strcasestr' is not defined in all enviroments: quicker fix is to use 'ndpi_strncasestr' instead. --- src/lib/protocols/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index b34206271..8b65ece50 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -464,8 +464,8 @@ static void ndpi_check_user_agent(struct ndpi_detection_module_struct *ndpi_stru */ if((strstr(ua, "+http") != NULL) || (strstr(ua, " http") != NULL) - || strcasestr(ua, "Crawler") - || strcasestr(ua, "Bot") /* bot/robot */ + || ndpi_strncasestr(ua, "Crawler", strlen(ua)) + || ndpi_strncasestr(ua, "Bot", strlen(ua)) /* bot/robot */ ) { ndpi_set_risk(ndpi_struct, flow, NDPI_HTTP_CRAWLER_BOT); } -- cgit v1.2.3