aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/softether.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/softether.c')
-rw-r--r--src/lib/protocols/softether.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/protocols/softether.c b/src/lib/protocols/softether.c
index e7328c8d7..6afdebb4a 100644
--- a/src/lib/protocols/softether.c
+++ b/src/lib/protocols/softether.c
@@ -288,6 +288,11 @@ static int dissect_softether_ip_port(struct ndpi_flow_struct *flow,
return 1;
}
+ if (ip_port_separator < (char const *)packet->payload + NDPI_STATICSTRING_LEN("IP="))
+ {
+ return 1;
+ }
+
ip_len = ndpi_min(sizeof(flow->protos.softether.ip) - 1,
ip_port_separator - (char const *)packet->payload -
NDPI_STATICSTRING_LEN("IP="));
@@ -295,6 +300,12 @@ static int dissect_softether_ip_port(struct ndpi_flow_struct *flow,
ip_len);
flow->protos.softether.ip[ip_len] = '\0';
+ if (ip_port_separator < (char const *)packet->payload +
+ NDPI_STATICSTRING_LEN("IP=") + NDPI_STATICSTRING_LEN(",PORT="))
+ {
+ return 1;
+ }
+
port_len = ndpi_min(sizeof(flow->protos.softether.port) - 1,
ip_port_separator - (char const *)packet->payload -
NDPI_STATICSTRING_LEN("IP=") - NDPI_STATICSTRING_LEN(",PORT="));