From 6b3c1992ff69e23bf324dfd3d7ced8e8d7a5a34f Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 5 Nov 2018 07:51:41 +0000 Subject: [PATCH] Protect the pointer array. --- Common/APRSCollector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/APRSCollector.cpp b/Common/APRSCollector.cpp index fc55fd5..40ff283 100644 --- a/Common/APRSCollector.cpp +++ b/Common/APRSCollector.cpp @@ -401,7 +401,7 @@ unsigned int CAPRSCollector::convertNMEA1(unsigned char* data, unsigned int) unsigned int nGGA = 0U; char* str = (char*)m_ggaData; - for (;;) { + while (nGGA < 20U) { char* p = mystrsep(&str, ",\r\n"); pGGA[nGGA++] = p; @@ -464,7 +464,7 @@ unsigned int CAPRSCollector::convertNMEA2(unsigned char* data, unsigned int) unsigned int nRMC = 0U; char* str = (char*)m_rmcData; - for (;;) { + while (nRMC < 20U) { char* p = mystrsep(&str, ",\r\n"); pRMC[nRMC++] = p;