diff options
author | Steven Moreland <smoreland@google.com> | 2019-09-30 09:03:07 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2019-09-30 18:11:07 +0000 |
commit | a46f1f84f682a775a33783875cfd1c05886778cf (patch) | |
tree | 9beefc74e2782b6977a39eabe5068a0e7e25bec2 /Parcel.cpp | |
parent | d0d9a80e02fef97cec6a3c19a99f551a6891c389 (diff) | |
download | libhwbinder-a46f1f84f682a775a33783875cfd1c05886778cf.tar.gz |
Fix segfault in readNullableNativeHandleNoDup.
Fixes: 141857065
Test: no longer segfaults w/ fuzzer repro
Change-Id: Ib7016cc3def89e7a13c00580949f52c5d9cc4f72
Diffstat (limited to 'Parcel.cpp')
-rw-r--r-- | Parcel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1457,6 +1457,12 @@ status_t Parcel::readNullableNativeHandleNoDup(const native_handle_t **handle, return status; } + if (*handle == nullptr) { + // null handle already read above + ALOGE("Expecting non-null handle buffer"); + return BAD_VALUE; + } + int numFds = (*handle)->numFds; int numInts = (*handle)->numInts; |