From 1b3055faefafe24cc21ede48ebc2ad67a022495e Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 23 May 2016 22:21:50 +0200 Subject: ndpi_main: fix Value stored to 'saddr'/'daddr' is never read --- src/lib/ndpi_main.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 221c073fd..db1543807 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3391,8 +3391,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); -- cgit v1.2.3 From bae6a09a7c200d216cdfea526fb9460cc070dbd6 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Tue, 24 May 2016 13:46:17 +0200 Subject: ndpi_main(.c): fix Null pointer passed as an argument to a 'nonnull' parameter --- src/lib/ndpi_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index db1543807..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); -- cgit v1.2.3