Fix for buffer overrun crash at copying nmea string
Add zero clearing of allocated nmea buffer to ensure
the nmea string is null terminated.
Change-Id: Ie36010a7d3eca16dabb3067ae891a94e4b63b10c
CRs-Fixed: 2041933
diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp
index 12f97dd..f4f07f2 100644
--- a/core/SystemStatus.cpp
+++ b/core/SystemStatus.cpp
@@ -1396,7 +1396,7 @@
}
char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 };
- strlcpy(buf, data, (len < strlen(data))? len : strlen(data));
+ strlcpy(buf, data, sizeof(buf));
pthread_mutex_lock(&mMutexSystemStatus);