mirror of
https://github.com/S3NEO/android_device_samsung_msm8226-common.git
synced 2024-11-06 21:55:45 +00:00
msm8226-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
7f16443813
commit
52a845523e
1 changed files with 2 additions and 2 deletions
|
@ -891,9 +891,9 @@ inline void LocEngReportStatus::log() const {
|
||||||
// case LOC_ENG_MSG_REPORT_NMEA:
|
// case LOC_ENG_MSG_REPORT_NMEA:
|
||||||
LocEngReportNmea::LocEngReportNmea(void* locEng,
|
LocEngReportNmea::LocEngReportNmea(void* locEng,
|
||||||
const char* data, int len) :
|
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();
|
locallog();
|
||||||
}
|
}
|
||||||
void LocEngReportNmea::proc() const {
|
void LocEngReportNmea::proc() const {
|
||||||
|
|
Loading…
Reference in a new issue