diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index 6936ea3..e70ae23 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -893,9 +893,9 @@ inline void LocEngReportStatus::log() const { // case LOC_ENG_MSG_REPORT_NMEA: LocEngReportNmea::LocEngReportNmea(void* locEng, const char* data, int len) : - LocMsg(), mLocEng(locEng), mNmea(new char[len]), mLen(len) + LocMsg(), mLocEng(locEng), mNmea(new char[len+1]), mLen(len) { - memcpy((void*)mNmea, (void*)data, len); + strlcpy(mNmea, data, len+1); locallog(); } void LocEngReportNmea::proc() const {