From 08844423e388ba349e6c3229b5656bf37c6caf3d Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 5 Nov 2018 07:48:23 +0000 Subject: [PATCH] Protect the pointer array. --- NXDNGateway/GPSHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NXDNGateway/GPSHandler.cpp b/NXDNGateway/GPSHandler.cpp index 9a565be..95dfd02 100644 --- a/NXDNGateway/GPSHandler.cpp +++ b/NXDNGateway/GPSHandler.cpp @@ -129,7 +129,7 @@ void CGPSHandler::processNMEA() char* p = NULL; char* d = (char*)(m_data + 1U); - while ((p = ::strtok(d, ",\r\n")) != NULL) { + while ((p = ::strtok(d, ",\r\n")) != NULL && nRMC < 20U) { pRMC[nRMC++] = p; d = NULL; }