Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e81a4f15 authored by Casey Dahlin's avatar Casey Dahlin Committed by Android (Google) Code Review
Browse files

Merge "Fix integer overflow in unsafeReadTypedVector" into nyc-dev

parents b17adaa8 65a8f07e
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -589,8 +589,16 @@ status_t Parcel::unsafeReadTypedVector(
        return UNEXPECTED_NULL;
        return UNEXPECTED_NULL;
    }
    }


    if (val->max_size() < size) {
        return NO_MEMORY;
    }

    val->resize(size);
    val->resize(size);


    if (val->size() < size) {
        return NO_MEMORY;
    }

    for (auto& v: *val) {
    for (auto& v: *val) {
        status = (this->*read_func)(&v);
        status = (this->*read_func)(&v);