summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author Casey Dahlin <sadmac@google.com> 2016-11-15 23:57:07 +0000
committer android-build-merger <android-build-merger@google.com> 2016-11-15 23:57:07 +0000
commitb7a1cc50d224140ee06a5a9d04b34fddf5ad7b3b (patch)
tree06421e98c287cf861e6a3ba65432036b2a686b35 /include
parentce40ad244154c875f1e1fd3cdce2c1440fe8fb6a (diff)
parent894ba10a5fa404314649870a1bbf7a41fb7755bd (diff)
Fix integer overflow in unsafeReadTypedVector am: 65a8f07e57
am: 894ba10a5f Change-Id: If93da0dbcbf78ea65e3ac950c5539861587526bb
Diffstat (limited to 'include')
-rw-r--r--include/binder/Parcel.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 1c355c4689..2490b82bb2 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -589,8 +589,16 @@ status_t Parcel::unsafeReadTypedVector(
return UNEXPECTED_NULL;
}
+ if (val->max_size() < size) {
+ return NO_MEMORY;
+ }
+
val->resize(size);
+ if (val->size() < size) {
+ return NO_MEMORY;
+ }
+
for (auto& v: *val) {
status = (this->*read_func)(&v);