aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-02-19 19:18:02 +0100
committerGitHub <noreply@github.com>2022-02-19 19:18:02 +0100
commitf28a3b293e8d103170155bd9137b33a5eddfd6ec (patch)
treed90cf1a74bc96a3cb9480694db5cd47b27570380 /src/lib/protocols
parenta2878af1eed26db8380bf8c29e5bb64a0181f935 (diff)
Fix compilation and sync unit tests results (#1445)
'strcasestr' is not defined in all enviroments: quicker fix is to use 'ndpi_strncasestr' instead.
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/http.c4
1 files changed, 2 insertions, 2 deletions
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);
}