From 6dfe32758e1a995b1241af8c981798c22cd70439 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Fri, 30 Aug 2024 10:14:56 +0100 Subject: New upstream version 6.0.24.42 --- CommonCode.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'CommonCode.c') diff --git a/CommonCode.c b/CommonCode.c index 3b7fb70..48a253d 100644 --- a/CommonCode.c +++ b/CommonCode.c @@ -4859,7 +4859,6 @@ DllExport uint64_t APIENTRY GetPortFrequency(int PortNo, char * FreqString) struct TNCINFO * TNC; struct RIGINFO * RIG = 0; - int RigPort; if (PORT->RIGPort) TNC = TNCInfo[PORT->RIGPort]; @@ -5089,6 +5088,8 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT) int len; char * ptr; char mhstr[400]; + int i; + char c; if (MH == NULL) return; @@ -5110,7 +5111,16 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT) continue; } - Normcall[len++] = 0; + // validate call to prevent corruption of json + + for (i=0; i < len; i++) + { + c = Normcall[i]; + + if (!isalnum(c) && !(c == '#') && !(c == ' ') && !(c == '-')) + goto skipit; + } + //format TIME @@ -5123,7 +5133,7 @@ void BuildPortMH(char * MHJSON, struct PORTCONTROL * PORT) Normcall, PORT->PORTNUMBER, MH->MHCOUNT, MHTIME); strcat( MHJSON, mhstr ); - +skipit: MH++; } } -- cgit v1.2.3