From 5ce60dc3fce19bcae334c9fae015b195672f1c26 Mon Sep 17 00:00:00 2001 From: Christian Deacon Date: Thu, 13 Jun 2024 19:51:47 -0400 Subject: [PATCH] Check if interface is null before starting sequence. --- src/sequence.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sequence.c b/src/sequence.c index b010050..4f34a53 100644 --- a/src/sequence.c +++ b/src/sequence.c @@ -711,10 +711,18 @@ void *thread_hdl(void *temp) **/ void seq_send(const char *interface, sequence_t seq, u16 seq_cnt2, cmd_line_t cmd) { - // First, let's check if the destination IP is set. + // First, make sure interface isn't NULL. + if (interface == NULL) + { + fprintf(stderr, "Interface not set on sequence #%d. Not moving forward with this sequence.\n", seq_cnt2); + + return; + } + + // Let's check if the destination IP is set. if (seq.ip.dst_ip == NULL) { - fprintf(stdout, "Destination IP not set on sequence #%u. Not moving forward with this sequence.\n", seq_cnt2); + fprintf(stderr, "Destination IP not set on sequence #%d. Not moving forward with this sequence.\n", seq_cnt2); return; }