diff options
author | Kevin Tang <zhikait@codeaurora.org> | 2017-04-28 16:31:43 -0700 |
---|---|---|
committer | Kevin Tang <zhikait@codeaurora.org> | 2017-04-28 16:31:46 -0700 |
commit | 222094ce77cc7a711f6e5af57bbd9fef473ae6ec (patch) | |
tree | cda0d9e259ef1b01e2e89f748e7e5b65f20578a7 | |
parent | 6cf01fac929e99f91df947d1791df7790ac956c1 (diff) | |
download | gps-222094ce77cc7a711f6e5af57bbd9fef473ae6ec.tar.gz |
Prevent print of uninitialized string
If uninitialized string gets printed, this can
cause a crash.
Bug: 37218688
CRs-fixed: 2032144
Change-Id: I7c34b6f84f414410c52fc59f73053892060b0874
-rw-r--r-- | android/Gnss.cpp | 2 | ||||
-rw-r--r-- | location/LocationAPI.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 9a362f0..9b2e7dd 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -85,7 +85,7 @@ GnssInterface* Gnss::getGnssInterface() { if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen("libgnss.so", RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) { diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 3086adc..60a46fe 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -82,7 +82,7 @@ static void* loadLocationInterface(const char* library, const char* name) { return NULL; } getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen(library, RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) { |