summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasha Levitskiy2015-06-18 18:08:14 -0500
committerSasha Levitskiy2015-06-22 15:16:51 -0500
commit99115b9148b214671af7da56ff3a1d238a3cf0c1 (patch)
tree46be589f95b0f37c6ae5912f3d4c6157e06c6ef8
parent1cddc2092f544c5eac339e59746436facfdd5dc7 (diff)
downloadplatform-system-core-99115b9148b214671af7da56ff3a1d238a3cf0c1.tar.gz
platform-system-core-99115b9148b214671af7da56ff3a1d238a3cf0c1.tar.xz
platform-system-core-99115b9148b214671af7da56ff3a1d238a3cf0c1.zip
Fingerprint: Safeguard against empty paths.
Bug 21930029 Change-Id: I116f4ec333d25406ba811fec7331cbf9ff1a4027 Signed-off-by: Sasha Levitskiy <sanek@google.com>
-rw-r--r--fingerprintd/FingerprintDaemonProxy.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fingerprintd/FingerprintDaemonProxy.cpp b/fingerprintd/FingerprintDaemonProxy.cpp
index a55f30a2d..4c8e47850 100644
--- a/fingerprintd/FingerprintDaemonProxy.cpp
+++ b/fingerprintd/FingerprintDaemonProxy.cpp
@@ -160,8 +160,8 @@ uint64_t FingerprintDaemonProxy::getAuthenticatorId() {
160 160
161int32_t FingerprintDaemonProxy::setActiveGroup(int32_t groupId, const uint8_t* path, 161int32_t FingerprintDaemonProxy::setActiveGroup(int32_t groupId, const uint8_t* path,
162 ssize_t pathlen) { 162 ssize_t pathlen) {
163 if (pathlen >= PATH_MAX) { 163 if (pathlen >= PATH_MAX || pathlen <= 0) {
164 ALOGE("Path name is too long\n"); 164 ALOGE("Bad path length: %zd", pathlen);
165 return -1; 165 return -1;
166 } 166 }
167 // Convert to null-terminated string 167 // Convert to null-terminated string
@@ -170,7 +170,6 @@ int32_t FingerprintDaemonProxy::setActiveGroup(int32_t groupId, const uint8_t* p
170 path_name[pathlen] = '\0'; 170 path_name[pathlen] = '\0';
171 ALOG(LOG_VERBOSE, LOG_TAG, "setActiveGroup(%d, %s, %zu)", groupId, path_name, pathlen); 171 ALOG(LOG_VERBOSE, LOG_TAG, "setActiveGroup(%d, %s, %zu)", groupId, path_name, pathlen);
172 return mDevice->set_active_group(mDevice, groupId, path_name); 172 return mDevice->set_active_group(mDevice, groupId, path_name);
173 return -1;
174} 173}
175 174
176int64_t FingerprintDaemonProxy::openHal() { 175int64_t FingerprintDaemonProxy::openHal() {