aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-04-28 23:08:54 +0200
committerLuca Deri <deri@ntop.org>2023-04-28 23:08:54 +0200
commit6b803f48dc34fe69bcc257b66fa05cac510e35b9 (patch)
tree7990d7d5ec28b11d8836f7bab56b42b42f93922f /src/lib/ndpi_main.c
parent6e9dce357bc9bcd7adbfb5e7b2749329e2b6319c (diff)
Added missing check
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 2f0dea90c..3a27ff740 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -7947,7 +7947,10 @@ ndpi_protocol ndpi_guess_undetected_protocol_v4(struct ndpi_detection_module_str
return ret;
if((proto == IPPROTO_TCP) || (proto == IPPROTO_UDP)) {
- rc = ndpi_search_tcp_or_udp_raw(ndpi_str, flow, proto, shost, dhost);
+ if(shost && dhost)
+ rc = ndpi_search_tcp_or_udp_raw(ndpi_str, flow, proto, shost, dhost);
+ else
+ rc = NDPI_PROTOCOL_UNKNOWN;
if(rc != NDPI_PROTOCOL_UNKNOWN) {
ret.app_protocol = rc,