OSDN Git Service

resolve merge conflicts of 70b9a03 to nyc-mr2-dev-plus-aosp
authorCasey Dahlin <sadmac@google.com>
Wed, 16 Nov 2016 01:01:46 +0000 (17:01 -0800)
committerCasey Dahlin <sadmac@google.com>
Wed, 16 Nov 2016 01:01:46 +0000 (17:01 -0800)
Change-Id: If543d1c9f9ae22a2803e16d257531335b2995a96

1  2 
include/binder/Parcel.h

@@@ -681,8 -589,16 +681,16 @@@ status_t Parcel::unsafeReadTypedVector
          return UNEXPECTED_NULL;
      }
  
 -    val->resize(size);
+     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);