From: Dave Hibberd Date: Wed, 24 Dec 2025 17:32:29 +0000 Subject: Resolve CVE-2025-34458 --- src/decode_aprs.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/decode_aprs.c b/src/decode_aprs.c index acfed6b..3b71129 100644 --- a/src/decode_aprs.c +++ b/src/decode_aprs.c @@ -1669,7 +1669,16 @@ static void aprs_mic_e (decode_aprs_t *A, packet_t pp, unsigned char *info, int char mcomment[256]; strlcpy (mcomment, ((char*)info) + sizeof(struct aprs_mic_e_s), sizeof(mcomment)); - assert (strlen(mcomment) > 0); + // This would seem redundant after the previous test of ilen. + // The contrived test case, in issue 618, contained a nul character + // near the end of the packet which should not happen with APRS. + // So strlen() turns out to be shorter than number of bytes. + + if (strlen(mcomment) < 1) { + // No comment. We are finished. + strlcpy (A->g_mfr, "UNKNOWN vendor/model", sizeof(A->g_mfr)); + return; + } if (mcomment[strlen(mcomment)-1] == '\r') { mcomment[strlen(mcomment)-1] = '\0'; @@ -4853,6 +4862,7 @@ static void process_comment (decode_aprs_t *A, char *pstart, int clen) * standardized format. * Don't complain if we have already found a valid value. */ + if (A->g_freq == G_UNKNOWN && regexec (&bad_freq_re, A->g_comment, MAXMATCH, match, 0) == 0) { char bad[30]; @@ -4879,6 +4889,8 @@ static void process_comment (decode_aprs_t *A, char *pstart, int clen) } } +// TODO: Don't complain if followed by %. e.g. Battery voltage 100%. + if (A->g_tone == G_UNKNOWN && regexec (&bad_tone_re, A->g_comment, MAXMATCH, match, 0) == 0) { char bad1[30]; /* original 99.9 or 999.9 format or one of 67 77 100 123 */