summaryrefslogtreecommitdiff
path: root/CommonCode.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-08-30 10:15:03 +0100
committerDave Hibberd <hibby@debian.org>2024-08-30 10:15:03 +0100
commitb26c87817a84747300d1ca59d80feff10976f22e (patch)
treef2fcfcd42b93b449850ab1f78c254af392b5c922 /CommonCode.c
parent60585818de254e8921fca42f55c175aa52e77e1e (diff)
parent6dfe32758e1a995b1241af8c981798c22cd70439 (diff)
Update upstream source from tag 'upstream/6.0.24.42'
Update to upstream version '6.0.24.42' with Debian dir 41e80b6ddfe044cd65e1f3985d66d43c24aadd9f
Diffstat (limited to 'CommonCode.c')
-rw-r--r--CommonCode.c16
1 files changed, 13 insertions, 3 deletions
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++;
}
}