aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-09-11 22:50:03 +0200
committerLuca Deri <deri@ntop.org>2023-09-11 22:50:03 +0200
commit1bf7e5face91e0fb103ac19dcacab65738e112be (patch)
tree8884f29d70fc3662d03636973b74e047850c2207 /src
parent8e6500a0da6798e2f2730ff88681c954ae7216d4 (diff)
Fixes matches with domain name strings that start with a dot
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_domain_classify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ndpi_domain_classify.c b/src/lib/ndpi_domain_classify.c
index 917c897f6..b56101a7e 100644
--- a/src/lib/ndpi_domain_classify.c
+++ b/src/lib/ndpi_domain_classify.c
@@ -91,7 +91,10 @@ bool ndpi_domain_classify_add(ndpi_domain_classify *s,
if(!s || !domain)
return(false);
-
+
+ /* Skip initial string . in domain names */
+ while(domain[0] == '.') domain++;
+
dot = strrchr(domain, '.');
if(!dot) return(false);