1
0
Fork 0

Fix GPS ident overflow bug

This commit is contained in:
James Turner 2019-04-23 18:09:59 +01:00
parent e15d67e637
commit a3e66d1ae3

View file

@ -947,8 +947,8 @@ const char* GPS::getWP0Ident() const
// work around std::string::c_str() storage lifetime with libc++
// real fix is to allow tie-ing with std::string instead of char*
static char identBuf[8];
strncpy(identBuf, _prevWaypt->ident().c_str(), 8);
static char identBuf[16];
strncpy(identBuf, _prevWaypt->ident().c_str(), 15);
return identBuf;
}
@ -975,8 +975,8 @@ const char* GPS::getWP1Ident() const
// work around std::string::c_str() storage lifetime with libc++
// real fix is to allow tie-ing with std::string instead of char*
static char identBuf[8];
strncpy(identBuf, _currentWaypt->ident().c_str(), 8);
static char identBuf[16];
strncpy(identBuf, _currentWaypt->ident().c_str(), 15);
return identBuf;
}