From 20cdaf399dfddb41245d90aa0aa86fce4bbc69e0 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Fri, 1 Mar 2019 14:30:16 +0100 Subject: fixed possible NULL ptr deref #2 Signed-off-by: Toni Uhlig --- src/pkt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pkt.c') diff --git a/src/pkt.c b/src/pkt.c index 8dc8baf..7ca6ade 100644 --- a/src/pkt.c +++ b/src/pkt.c @@ -369,7 +369,9 @@ void handle_data(icmp_echo_packet_t *pkt, int total_len, forward_desc_t *ring[], } return; } - if (next_expected_seq && pt_pkt->seq_no == *next_expected_seq) { + if (!next_expected_seq) + return; + if (pt_pkt->seq_no == *next_expected_seq) { /* hmm, what happens if this test is true? */ if (!ring[*insert_idx]) { /* && pt_pkt->state == kProto_data */ /* pt_log(kLog_debug, "Queing data packet: %d\n", pt_pkt->seq_no); */ -- cgit v1.2.3