From cf905d0c7f531236697a9ca4784570b03375e160 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 23 May 2016 22:18:31 +0200 Subject: FTP: fix Value stored to 'packet' during its initialization is never read --- src/lib/protocols/ftp_data.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/ftp_data.c b/src/lib/protocols/ftp_data.c index 32774899c..7daf9190d 100644 --- a/src/lib/protocols/ftp_data.c +++ b/src/lib/protocols/ftp_data.c @@ -230,7 +230,6 @@ static void ndpi_check_ftp_data(struct ndpi_detection_module_struct *ndpi_struct } void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - struct ndpi_packet_struct *packet = &flow->packet; /* Break after 20 packets. */ if(flow->packet_counter > 20) { -- cgit v1.2.3 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') 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 7fb4b4209242813f3b3bddbbeefe4a8966a3f35c Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 23 May 2016 22:30:47 +0200 Subject: bittorrent: fix Value stored to 'a' is never read --- src/lib/protocols/bittorrent.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 8213d3b45..6ac9ec69a 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -135,7 +135,6 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module || memcmp(packet->payload, "POST ", 5) == 0)) { const u_int8_t *ptr = &packet->payload[4]; u_int16_t len = packet->payload_packet_len - 4; - a = 0; /* parse complete get packet here into line structure elements */ -- cgit v1.2.3 From e0e1ed6936081875c28d37120b9fec9960dfa0bd Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 23 May 2016 22:32:39 +0200 Subject: rtcp: fix Value stored to 'sport'/'dport' is never read --- src/lib/protocols/rtcp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/rtcp.c b/src/lib/protocols/rtcp.c index be4aee669..cc6265220 100644 --- a/src/lib/protocols/rtcp.c +++ b/src/lib/protocols/rtcp.c @@ -48,7 +48,6 @@ void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct n offset += rtcp_section_len; } - sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest); NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over udp.\n"); /* TODO changed a pair of length condition to the && from ||. Is it correct? */ if(((packet->payload_packet_len >= 28 && packet->payload_packet_len <= 1200) && -- 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') 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