From 75781264549880da270e28049eb53eb5f3d46c3a Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sat, 3 Feb 2018 16:31:22 +0000 Subject: [PATCH] Prevent a crash caused by a certain type of false decode. Update copyright date. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8452 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/wsprd/wsprd_exp.c | 3 +-- lib/wsprd/wsprsim_utils.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/wsprd/wsprd_exp.c b/lib/wsprd/wsprd_exp.c index d501f873f..2f251da7b 100644 --- a/lib/wsprd/wsprd_exp.c +++ b/lib/wsprd/wsprd_exp.c @@ -713,7 +713,7 @@ void usage(void) //*************************************************************************** int main(int argc, char *argv[]) { - char cr[] = "(C) 2016, Steven Franke - K9AN"; + char cr[] = "(C) 2018, Steven Franke - K9AN"; (void)cr; extern char *optarg; extern int optind; @@ -1316,7 +1316,6 @@ int main(int argc, char *argv[]) } else { break; } - } // Remove dupes (same callsign and freq within 3 Hz) diff --git a/lib/wsprd/wsprsim_utils.c b/lib/wsprd/wsprsim_utils.c index 44781e777..7f2c1b4df 100644 --- a/lib/wsprd/wsprsim_utils.c +++ b/lib/wsprd/wsprsim_utils.c @@ -238,7 +238,7 @@ int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* sym } else if ( i2 < mlen ) { // just looks for a right slash // Type 2: PJ4/K1ABC 37 callsign=strtok(message," "); - if( strlen(callsign) < i2 ) return 0; //guards against pathological case + if( i2==0 || i2>strlen(callsign) ) return 0; //guards against pathological case powstr=strtok(NULL," "); int power = atoi(powstr); if( power < 0 ) power=0;