Skip to content

Commit

Permalink
Check if interface is null before starting sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemann committed Jun 13, 2024
1 parent bca5989 commit 5ce60dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5ce60dc

Please sign in to comment.