summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-05-27 17:53:02 -0700
committerThe Android Automerger <android-build@google.com>2015-08-13 19:41:48 -0700
commite68cbc3e9e66df4231e70efa3e9c41abc12aea20 (patch)
treea9f9f223944d8a00fa8c374dffad81a7701451a6
parent7dcd0ec9c91688cfa3f679804ba6e132f9811254 (diff)
downloadframeworks_native-android-5.1.1_r16.zip
frameworks_native-android-5.1.1_r16.tar.gz
frameworks_native-android-5.1.1_r16.tar.bz2
When appending one parcel's contents to another, ignore binder objects within the source Parcel that appear to lie beyond the formal bounds of that Parcel's data buffer. Bug 17312693 Change-Id: If592a260f3fcd9a56fc160e7feb2c8b44c73f514 (cherry picked from commit 27182be9f20f4f5b48316666429f09b9ecc1f22e)
-rw-r--r--libs/binder/Parcel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 99c934c..87ce5d0 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -411,7 +411,7 @@ status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len)
// Count objects in range
for (int i = 0; i < (int) size; i++) {
size_t off = objects[i];
- if ((off >= offset) && (off < offset + len)) {
+ if ((off >= offset) && (off + sizeof(flat_binder_object) <= offset + len)) {
if (firstIndex == -1) {
firstIndex = i;
}