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

Commit d7af1311 authored by Steven Moreland's avatar Steven Moreland Committed by Android (Google) Code Review
Browse files

Merge "libbinder: remove writeUnpadded" into main

parents 6a35338f f99572ae
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -1150,31 +1150,6 @@ status_t Parcel::finishWrite(size_t len)
    return NO_ERROR;
}

status_t Parcel::writeUnpadded(const void* data, size_t len)
{
    if (len > INT32_MAX) {
        // don't accept size_t values which may have come from an
        // inadvertent conversion from a negative int.
        return BAD_VALUE;
    }

    size_t end = mDataPos + len;
    if (end < mDataPos) {
        // integer overflow
        return BAD_VALUE;
    }

    if (end <= mDataCapacity) {
restart_write:
        memcpy(mData+mDataPos, data, len);
        return finishWrite(len);
    }

    status_t err = growData(len);
    if (err == NO_ERROR) goto restart_write;
    return err;
}

status_t Parcel::write(const void* data, size_t len)
{
    if (len > INT32_MAX) {
+0 −1
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ public:

    LIBBINDER_EXPORTED status_t write(const void* data, size_t len);
    LIBBINDER_EXPORTED void* writeInplace(size_t len);
    LIBBINDER_EXPORTED status_t writeUnpadded(const void* data, size_t len);
    LIBBINDER_EXPORTED status_t writeInt32(int32_t val);
    LIBBINDER_EXPORTED status_t writeUint32(uint32_t val);
    LIBBINDER_EXPORTED status_t writeInt64(int64_t val);