Replace unsafe functions
Replace strncpy with strlcpy Change-Id: Iade6b1201db75fb15da37431183cb372cd1ad41a CRs-fixed: 2298929
This commit is contained in:
parent
4088ca58bc
commit
4599ab400c
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type)
|
||||||
if (LOC_AGPS_SUPL_SERVER == type) {
|
if (LOC_AGPS_SUPL_SERVER == type) {
|
||||||
int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ?
|
int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ?
|
||||||
strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1);
|
strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1);
|
||||||
strncpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy);
|
strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy);
|
||||||
ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0';
|
ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0';
|
||||||
ContextBase::mGps_conf.SUPL_PORT = port;
|
ContextBase::mGps_conf.SUPL_PORT = port;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue