From 7b5fc163dc9bdc74facc238127b6f0440395fc3c Mon Sep 17 00:00:00 2001 From: wb2osz Date: Sun, 17 Feb 2019 21:11:40 -0500 Subject: [PATCH] More error checking. --- ax25_pad.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ax25_pad.c b/ax25_pad.c index e584d0b..036665b 100644 --- a/ax25_pad.c +++ b/ax25_pad.c @@ -1295,7 +1295,11 @@ void ax25_get_addr_with_ssid (packet_t this_p, int n, char *station) station[6] = '\0'; for (i=5; i>=0; i--) { - if (station[i] == ' ') + if (station[i] == '\0') { + text_color_set(DW_COLOR_ERROR); + dw_printf ("Station address \"%s\" contains nul character. AX.25 protocol requires trailing ASCII spaces when less than 6 characters.\n", station); + } + else if (station[i] == ' ') station[i] = '\0'; else break;