summaryrefslogtreecommitdiff
path: root/gnss
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2018-08-24 16:57:57 -0700
committerKevin Tang <zhikait@codeaurora.org>2018-08-24 16:57:57 -0700
commit0a196513162c60f595e1c5cea351900c1eb77019 (patch)
treefd0d37293908d8d3808dff0ba161eac1dc209d7e /gnss
parentd2980eb906a57d6d2179786d35f681178c76a4b9 (diff)
downloadgps-0a196513162c60f595e1c5cea351900c1eb77019.tar.gz
GPS: unify buffer size passed to retrieve string with loc cfg
Loc cfg parsing routines assuming that string buffer size is LOC_MAX_PARAM_STRING. Changes are to make sure that caller to loc cfg routine does use that buffer of size LOC_MAX_PARAM_STRING. Change-Id: Icecf6bf017e6dda1da0766adc746f60d471653d0 CRs-fixed: 2301437
Diffstat (limited to 'gnss')
-rw-r--r--gnss/GnssAdapter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index b9653fb..a40fe71 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -629,10 +629,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type)
url.assign(serverUrl);
if (LOC_AGPS_SUPL_SERVER == type) {
- int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ?
- strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1);
- strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy);
- ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0';
+ strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING);
ContextBase::mGps_conf.SUPL_PORT = port;
}