summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-05-28 22:30:05 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-28 22:30:05 +0000
commitd2fb7a6e49f04182ba7b639c340414b1745137f2 (patch)
tree993ae931ab613772485020a1376b2352db74cbf5 /libs
parent5d10894c9d547449cf231f02b736da9dfdebec11 (diff)
parent8728c390476110857dd6b290dac3bfdf13b33e81 (diff)
downloadframeworks_native-d2fb7a6e49f04182ba7b639c340414b1745137f2.zip
frameworks_native-d2fb7a6e49f04182ba7b639c340414b1745137f2.tar.gz
frameworks_native-d2fb7a6e49f04182ba7b639c340414b1745137f2.tar.bz2
am 8728c390: am 2c4f5fde: am 861c3f56: am 9004e7f5: am 4ff0cb44: Verify that the native handle was created
* commit '8728c390476110857dd6b290dac3bfdf13b33e81': Verify that the native handle was created
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/Parcel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 2c566f9..b2a4aae 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1230,6 +1230,10 @@ native_handle* Parcel::readNativeHandle() const
if (err != NO_ERROR) return 0;
native_handle* h = native_handle_create(numFds, numInts);
+ if (!h) {
+ return 0;
+ }
+
for (int i=0 ; err==NO_ERROR && i<numFds ; i++) {
h->data[i] = dup(readFileDescriptor());
if (h->data[i] < 0) err = BAD_VALUE;