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

Commit 3ec9d06f authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "MtpDevice: Handle zero length packets in readResponse()" into honeycomb-mr1

parents 7ea3c7f5 90f5d75c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -819,6 +819,10 @@ MtpResponseCode MtpDevice::readResponse() {
        return mResponse.getResponseCode();
    }
    int ret = mResponse.read(mRequestIn1);
    // handle zero length packets, which might occur if the data transfer
    // ends on a packet boundary
    if (ret == 0)
        ret = mResponse.read(mRequestIn1);
    if (ret >= MTP_CONTAINER_HEADER_SIZE) {
        mResponse.dump();
        return mResponse.getResponseCode();