From c7eb8d1082b5c7494a373b6b48403e3ae6c4cce3 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sat, 12 Nov 2016 16:00:02 +0100 Subject: HTTP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang Analyzer --- src/lib/protocols/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 11ea138db..4e4d01ca2 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -164,7 +164,7 @@ static void setHttpUserAgent(struct ndpi_flow_struct *flow, char *ua) { static void parseHttpSubprotocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { // int i = 0; - struct ndpi_packet_struct *packet = &flow->packet; + //struct ndpi_packet_struct *packet = &flow->packet; if((flow->l4.tcp.http_stage == 0) || (flow->http.url && flow->http_detected)) { -- cgit v1.2.3 From 800ad1737c7d284b579a369264fceca109b8a496 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sat, 12 Nov 2016 16:02:25 +0100 Subject: COAP: fix typo about checking twice source port Found via Clang Analyzer (Used d_port variable) --- src/lib/protocols/coap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/coap.c b/src/lib/protocols/coap.c index 5f8e97863..252ffc9c4 100644 --- a/src/lib/protocols/coap.c +++ b/src/lib/protocols/coap.c @@ -115,7 +115,7 @@ void ndpi_search_coap (struct ndpi_detection_module_struct *ndpi_struct, u_int16_t s_port = ntohs(flow->packet.udp->source); u_int16_t d_port = ntohs(flow->packet.udp->dest); - if((!isCoAPport(s_port) && !isCoAPport(s_port)) + if((!isCoAPport(s_port) && !isCoAPport(d_port)) || (packet->payload_packet_len < 4) // header too short ) { NDPI_LOG(NDPI_PROTOCOL_COAP, ndpi_struct, NDPI_LOG_DEBUG, "excluding Coap\n"); -- cgit v1.2.3