summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-05-27 17:53:02 -0700
committerChristopher Hocutt <hocutt@google.com>2015-06-24 20:46:58 +0000
commitbb686c25b214edadd1830abd056db2d570d716ff (patch)
tree55c10109cd5bd8d97742e491de3ddacdef6df40c /libs
parent4ff0cb4404db31576cd8a81ca5ef3b044d492904 (diff)
downloadframeworks_native-bb686c25b214edadd1830abd056db2d570d716ff.zip
frameworks_native-bb686c25b214edadd1830abd056db2d570d716ff.tar.gz
frameworks_native-bb686c25b214edadd1830abd056db2d570d716ff.tar.bz2
Disregard alleged binder entities beyond parcel bounds
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)
Diffstat (limited to 'libs')
-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 e5a2871..0464e93 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -384,7 +384,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;
}