resolve merge conflicts of 70b9a03 to nyc-mr2-dev-plus-aosp
am: 29dedec71a
Change-Id: I466f01c11ccaf6fe84cbabf4de44bd7485946903
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 39deb64..0922c34 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -697,8 +697,16 @@
return UNEXPECTED_NULL;
}
+ if (val->max_size() < size) {
+ return NO_MEMORY;
+ }
+
val->resize(static_cast<size_t>(size));
+ if (val->size() < size) {
+ return NO_MEMORY;
+ }
+
for (auto& v: *val) {
status = (this->*read_func)(&v);