From 5cecc7a9ab3c2eb7613293be3d425ceb8f251e9c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 21 Jul 2022 12:42:06 +0800 Subject: [PATCH 1/2] Don't check senentence length less than MINMEA_MAX_SENTENCE_LENGTH in minmea_check since the whole code base can support any length without problem Signed-off-by: Xiang Xiao Change-Id: I49184d41154dcc857d0ff630bcab5c62add165de --- minmea.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/minmea.c b/minmea.c index e9361cc..e43ee99 100644 --- a/minmea.c +++ b/minmea.c @@ -46,10 +46,6 @@ bool minmea_check(const char *sentence, bool strict) { uint8_t checksum = 0x00; - // Sequence length is limited. - if (strlen(sentence) > MINMEA_MAX_SENTENCE_LENGTH + 3) - return false; - // A valid sentence starts with "$". if (*sentence++ != '$') return false; From 476a8dd63efcf9f7493e6dc44b5d2e06574788a9 Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Thu, 4 Aug 2022 11:35:15 +0100 Subject: [PATCH 2/2] tests: update sentence length test --- tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.c b/tests.c index 90a935e..8e135e0 100644 --- a/tests.c +++ b/tests.c @@ -18,6 +18,8 @@ static const char *valid_sentences_nochecksum[] = { "$GPTXT,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "$GPTXT,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "$GPTXT,hello\n", "$GPTXT,hello\r", "$GPTXT,hello\r\n", @@ -51,8 +53,6 @@ static const char *valid_sentences_checksum[] = { }; static const char *invalid_sentences[] = { - "$GPTXT,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "$GPTXT,01,01,02,ANTSTATUS=INIT*26", "$GPRMC,,V,,,,,,,,,,N*532", "$GPVTG,,,,\xff,,,,,N*30",