msm8974-common: gps: Adding fix for KW warning
Fix for buffer overflow possibility for the thread name passed in to pthread_setname_np() method. Change-Id: Id323dd058eddcf50d6fd9ec8908e9997b30c561b CRs-Fixed: 999457
This commit is contained in:
parent
e2e1b9d26a
commit
6b9221934a
@ -84,9 +84,7 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
|
|||||||
if (mThandle) {
|
if (mThandle) {
|
||||||
// set thread name
|
// set thread name
|
||||||
char lname[16];
|
char lname[16];
|
||||||
int len = sizeof(lname) - 1;
|
strlcpy(lname, threadName, sizeof(lname));
|
||||||
memcpy(lname, threadName, len);
|
|
||||||
lname[len] = 0;
|
|
||||||
// set the thread name here
|
// set the thread name here
|
||||||
pthread_setname_np(mThandle, lname);
|
pthread_setname_np(mThandle, lname);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user