Memset the xtra url to assure null termination
Fixes a potential crash in jni layer caused by invalid characters in the string. CRs-fixed: 555829 Change-Id: I03ae100c4b7e65c95bac5841fcf00b27e2940741
This commit is contained in:
parent
35abbdde0c
commit
000b1ecea4
1 changed files with 1 additions and 0 deletions
|
@ -875,6 +875,7 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng,
|
||||||
LocMsg(), mLocEng(locEng), mMaxLen(maxlength),
|
LocMsg(), mLocEng(locEng), mMaxLen(maxlength),
|
||||||
mServers(new char[3*(mMaxLen+1)])
|
mServers(new char[3*(mMaxLen+1)])
|
||||||
{
|
{
|
||||||
|
memset(mServers, 0, 3*(mMaxLen+1));
|
||||||
strlcpy(mServers, url1, mMaxLen);
|
strlcpy(mServers, url1, mMaxLen);
|
||||||
strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen);
|
strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen);
|
||||||
strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen);
|
strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen);
|
||||||
|
|
Loading…
Reference in a new issue