summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-07-07 11:51:12 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-07-07 14:15:35 -0700
commitcf27ee8089344479bdfd53568bd105d8d50e9275 (patch)
tree061d9cbfc9c44cb53bc4e4457bc881467dcfdf71 /libs
parent2a2eaab883bd243493407cce47382d372f207492 (diff)
parent54cb02ad733fb71b1bdf78590428817fb780aff8 (diff)
downloadframeworks_native-cf27ee8089344479bdfd53568bd105d8d50e9275.zip
frameworks_native-cf27ee8089344479bdfd53568bd105d8d50e9275.tar.gz
frameworks_native-cf27ee8089344479bdfd53568bd105d8d50e9275.tar.bz2
Merge remote-tracking branch 'remotes/android-6.0.1_r52' into HEAD
Ticket: CYNGNOS-3020 Change-Id: I13076de5caf1546b8eef44417ee83cd9b2cb9d62
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/Parcel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 4f539a8..cf22e58 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1389,7 +1389,13 @@ native_handle* Parcel::readNativeHandle() const
for (int i=0 ; err==NO_ERROR && i<numFds ; i++) {
h->data[i] = dup(readFileDescriptor());
- if (h->data[i] < 0) err = BAD_VALUE;
+ if (h->data[i] < 0) {
+ for (int j = 0; j < i; j++) {
+ close(h->data[j]);
+ }
+ native_handle_delete(h);
+ return 0;
+ }
}
err = read(h->data + numFds, sizeof(int)*numInts);
if (err != NO_ERROR) {