mirror of
https://github.com/team-infusion-developers/android_device_samsung_msm8976-common.git
synced 2024-11-07 06:19:20 +00:00
msm8976-common: gps: 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: I78e8b03bc7d0f9b69e1a51356da379a57a647cad CRs-Fixed: 2041933
This commit is contained in:
parent
e474914e6b
commit
1f63b1236c
1 changed files with 2 additions and 2 deletions
|
@ -923,9 +923,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 {
|
||||
|
|
Loading…
Reference in a new issue