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

Commit 808fa88b authored by Alex Klyubin's avatar Alex Klyubin Committed by Android (Google) Code Review
Browse files

Merge "readAt can return negative values (error codes)." into mnc-dev

parents fa907d4e 61c83317
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -107,7 +107,14 @@ struct BpMediaHTTPConnection : public BpInterface<IMediaHTTPConnection> {
            return UNKNOWN_ERROR;
        }

        size_t len = reply.readInt32();
        int32_t lenOrErrorCode = reply.readInt32();

        // Negative values are error codes
        if (lenOrErrorCode < 0) {
            return lenOrErrorCode;
        }

        size_t len = lenOrErrorCode;

        if (len > size) {
            ALOGE("requested %zu, got %zu", size, len);