Check the fd handle before attempting to use it in GNSS HAL

Bug: 171851344
Test: run vts -a x86 -m vts_ibase_test -t VtsHalBaseV1_0TargetTest#Debug
Change-Id: Ieee0977812fe6a9a9ca4bb2fe9ab61899b4d0df5
This commit is contained in:
Enrico Granata 2020-10-30 14:42:49 -06:00
parent 2c51ab2ebc
commit 063094e1a7

View file

@ -689,6 +689,10 @@ Return<void> GnssTemplate<T_IGnss>::help(const hidl_handle& fd) {
template <class T_IGnss>
Return<void> GnssTemplate<T_IGnss>::debug(const hidl_handle& fd,
const hidl_vec<hidl_string>& options) {
if (fd == nullptr || fd->numFds == 0) {
return Void();
}
if (options.size() == 0) {
return help(fd);
} else if (options[0] == "location") {