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

Commit c8ddb017 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz Committed by Android (Google) Code Review
Browse files

Merge "Logging for catching memory issue in Parcel" into oc-dev

parents 4ba6f990 c65de597
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2547,8 +2547,16 @@ status_t Parcel::continueWrite(size_t desired)
            objectsSize = 0;
        } else {
            while (objectsSize > 0) {
                if (mObjects[objectsSize-1] < desired)
                if (mObjects[objectsSize-1] < desired) {
                    // Check for an object being sliced
                    if (desired < mObjects[objectsSize-1] + sizeof(flat_binder_object)) {
                        ALOGE("Attempt to shrink Parcel would slice an objects allocated memory");
                        return UNKNOWN_ERROR + 0xBADF10;
                    }
                    break;
                }
                // STOPSHIP: Above code to be replaced with following commented code:
                // if (mObjects[objectsSize-1] + sizeof(flat_binder_object) <= desired) break;
                objectsSize--;
            }
        }