Skip to content

Commit 1c14d4b

Browse files
author
Alexandra Sandulescu
committed
gen_packets: fix crash in send_packet
** due to improper sanitization of ax25_from_text result, ax25_pack crashes when pp is NULL
1 parent a1e2d1c commit 1c14d4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gen_packets.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ static void send_packet (char *str)
116116
}
117117
else {
118118
pp = ax25_from_text (str, 1);
119+
if (pp == NULL) {
120+
text_color_set(DW_COLOR_ERROR);
121+
dw_printf ("Failed to create frame from text.\n");
122+
return;
123+
}
124+
119125
flen = ax25_pack (pp, fbuf);
120126
for (c=0; c<modem.adev[0].num_channels; c++)
121127
{

0 commit comments

Comments
 (0)