From 1c14d4b39c572bda858c560e601d9313e6898ae4 Mon Sep 17 00:00:00 2001 From: Alexandra Sandulescu Date: Mon, 18 May 2020 16:57:33 +0200 Subject: [PATCH] gen_packets: fix crash in send_packet ** due to improper sanitization of ax25_from_text result, ax25_pack crashes when pp is NULL --- gen_packets.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gen_packets.c b/gen_packets.c index 62133a9c..45d35528 100644 --- a/gen_packets.c +++ b/gen_packets.c @@ -116,6 +116,12 @@ static void send_packet (char *str) } else { pp = ax25_from_text (str, 1); + if (pp == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Failed to create frame from text.\n"); + return; + } + flen = ax25_pack (pp, fbuf); for (c=0; c