gen_packets: fix crash in send_packet

** due to improper sanitization of ax25_from_text result, ax25_pack crashes when pp is NULL
This commit is contained in:
Alexandra Sandulescu 2020-05-18 16:57:33 +02:00
parent a1e2d1c3a8
commit 1c14d4b39c
1 changed files with 6 additions and 0 deletions

View File

@ -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<modem.adev[0].num_channels; c++)
{