aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 221c073fd..2e2ac21ef 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -550,7 +550,11 @@ static int ndpi_string_to_automa(struct ndpi_detection_module_struct *ndpi_struc
if(automa->ac_automa == NULL) return(-2);
ac_pattern.astring = value;
ac_pattern.rep.number = protocol_id;
- ac_pattern.length = strlen(ac_pattern.astring);
+ if(value == NULL)
+ ac_pattern.length = 0;
+ else
+ ac_pattern.length = strlen(ac_pattern.astring);
+
ac_automata_add(((AC_AUTOMATA_t*)automa->ac_automa), &ac_pattern);
return(0);
@@ -3391,8 +3395,6 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct
#endif
{
protocol = flow->packet.iph->protocol;
- saddr = ntohl(flow->packet.iph->saddr);
- daddr = ntohl(flow->packet.iph->daddr);
}
if(flow->packet.udp) sport = ntohs(flow->packet.udp->source), dport = ntohs(flow->packet.udp->dest);