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

Commit c26006b1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder: RPC - better error for malformed parcel" am: 76473a11 am: ebe76514

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1838241

Change-Id: I3e8d01cbd7853c77c02d0e1558136803f5207019
parents 56294e27 ebe76514
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -427,12 +427,16 @@ status_t RpcState::transact(const sp<RpcSession::RpcConnection>& connection,
                            const sp<IBinder>& binder, uint32_t code, const Parcel& data,
                            const sp<RpcSession>& session, Parcel* reply, uint32_t flags) {
    if (!data.isForRpc()) {
        ALOGE("Refusing to send RPC with parcel not crafted for RPC");
        ALOGE("Refusing to send RPC with parcel not crafted for RPC call on binder %p code "
              "%" PRIu32,
              binder.get(), code);
        return BAD_TYPE;
    }

    if (data.objectsCount() != 0) {
        ALOGE("Parcel at %p has attached objects but is being used in an RPC call", &data);
        ALOGE("Parcel at %p has attached objects but is being used in an RPC call on binder %p "
              "code %" PRIu32,
              &data, binder.get(), code);
        return BAD_TYPE;
    }