From c538cac769dcf0f84730237de04a43c645fae502 Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 17 Jan 2025 19:59:25 +0100 Subject: [PATCH] [Morse] Fix possible overflow --- src/protocols/Morse/Morse.cpp | 2 +- src/protocols/Morse/Morse.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocols/Morse/Morse.cpp b/src/protocols/Morse/Morse.cpp index 5ea1ff63..c2ee4d74 100644 --- a/src/protocols/Morse/Morse.cpp +++ b/src/protocols/Morse/Morse.cpp @@ -56,7 +56,7 @@ char MorseClient::decode(uint8_t symbol, uint8_t len) { } // nothing found - return(RADIOLIB_MORSE_UNSUPPORTED); + return(RADIOLIB_MORSE_UNKNOWN_SYMBOL); } #if !RADIOLIB_EXCLUDE_AFSK diff --git a/src/protocols/Morse/Morse.h b/src/protocols/Morse/Morse.h index 78d6a910..abc56890 100644 --- a/src/protocols/Morse/Morse.h +++ b/src/protocols/Morse/Morse.h @@ -14,6 +14,7 @@ #define RADIOLIB_MORSE_INTER_SYMBOL 0x00 #define RADIOLIB_MORSE_CHAR_COMPLETE 0x01 #define RADIOLIB_MORSE_WORD_COMPLETE 0x02 +#define RADIOLIB_MORSE_UNKNOWN_SYMBOL '*' // Morse character table: - using codes defined in ITU-R M.1677-1 // - Morse code representation is saved LSb first, using additional bit as guard