diff options
| author | 2015-05-13 03:38:35 +0000 | |
|---|---|---|
| committer | 2015-05-13 03:38:36 +0000 | |
| commit | 4b4820db4b83875ec5bbae11e468f36f21e5334c (patch) | |
| tree | 66c2c92aeaf1fadec54ca396aebf46a8ab6e37d3 | |
| parent | 48cb8310e267d177856ad9b2af7b9949d7d62424 (diff) | |
| parent | eaac99a7172da52a76ba48c26413778a74951b1a (diff) | |
Merge "Verify that the native handle was created" into mnc-dev
| -rw-r--r-- | libs/binder/Parcel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 1b197a4353..015866bb6f 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1347,6 +1347,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; |