diff options
author | Campus <campus@ntop.org> | 2017-05-18 10:47:17 +0200 |
---|---|---|
committer | Campus <campus@ntop.org> | 2017-05-18 10:47:17 +0200 |
commit | b4b682a4bf85a330163af9b588cc7d0830e31b23 (patch) | |
tree | ace88bd177bdf4a42e81066abef4c9fd55d993ab | |
parent | 2b128a2f1bfbb1dcd46b5a9d692c792c42212b99 (diff) | |
parent | 167732cae40fdfb8cb9fe2766f4671363f8672e6 (diff) |
Merge branch 'pavlosantoniou-dev' into dev
-rw-r--r-- | src/lib/ndpi_main.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 80ad78183..040c54959 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2955,17 +2955,19 @@ static int ndpi_init_packet_header(struct ndpi_detection_module_struct *ndpi_str u_int8_t l4protocol; u_int8_t l4_result; - /* reset payload_packet_len, will be set if ipv4 tcp or udp */ - flow->packet.payload_packet_len = 0; - flow->packet.l4_packet_len = 0; - flow->packet.l3_packet_len = packetlen; - - flow->packet.tcp = NULL; - flow->packet.udp = NULL; - flow->packet.generic_l4_ptr = NULL; + if (flow) { + /* reset payload_packet_len, will be set if ipv4 tcp or udp */ + flow->packet.payload_packet_len = 0; + flow->packet.l4_packet_len = 0; + flow->packet.l3_packet_len = packetlen; + + flow->packet.tcp = NULL; + flow->packet.udp = NULL; + flow->packet.generic_l4_ptr = NULL; #ifdef NDPI_DETECTION_SUPPORT_IPV6 - flow->packet.iphv6 = NULL; + flow->packet.iphv6 = NULL; #endif /* NDPI_DETECTION_SUPPORT_IPV6 */ + } if(flow) { ndpi_apply_flow_protocol_to_packet(flow, &flow->packet); |