aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-03-01 14:30:16 +0100
committerToni Uhlig <matzeton@googlemail.com>2019-03-01 14:30:16 +0100
commit20cdaf399dfddb41245d90aa0aa86fce4bbc69e0 (patch)
tree2414058a3353a5ed2e80555cd42522b85e241f10
parent0aa06b84600a0b32b4e01dbc6900914a6dcedc0c (diff)
fixed possible NULL ptr deref #2
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--src/pkt.c4
1 files changed, 3 insertions, 1 deletions
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); */