You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is regarding lines 677 to 687 in the wspr_message_prep function in JTEncode.cpp.
The code cycle through 12 characters of "call", and unless a char is '/', '<' or '>' it replaces non digits or non uppercase characters with a space.
The problem is if "call" points to a 6 character callsign that is null terminated in the 7th character, then the code replaces the null with a space. You now have an unterminated character array with undefined garbage in characters 8 through 12.
Not an issue 99% of the time, because the garbage characters will probably also be replaced by spaces.
But every once in a while the garbage characters include a '/' which will not get replaced with a space. The downstream code sees the '/' and thinks your trying to send a WSPR Type-3 message with prefix, and you end up with an incorrectly encoded WSPR message.
A workaround is to make sure any string you pass for the call is padded with spaces to the 12th character. A better solution imho is if the code in lines 677 to 687 would leave NULLs alone.
The text was updated successfully, but these errors were encountered:
this is regarding lines 677 to 687 in the wspr_message_prep function in JTEncode.cpp.
The code cycle through 12 characters of "call", and unless a char is '/', '<' or '>' it replaces non digits or non uppercase characters with a space.
The problem is if "call" points to a 6 character callsign that is null terminated in the 7th character, then the code replaces the null with a space. You now have an unterminated character array with undefined garbage in characters 8 through 12.
Not an issue 99% of the time, because the garbage characters will probably also be replaced by spaces.
But every once in a while the garbage characters include a '/' which will not get replaced with a space. The downstream code sees the '/' and thinks your trying to send a WSPR Type-3 message with prefix, and you end up with an incorrectly encoded WSPR message.
A workaround is to make sure any string you pass for the call is padded with spaces to the 12th character. A better solution imho is if the code in lines 677 to 687 would leave NULLs alone.
The text was updated successfully, but these errors were encountered: