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

Commit e13dde8c authored by Steven Moreland's avatar Steven Moreland
Browse files

Binder: consistency of death recipient in unlink

BpBinder::unlinkToDeath guarantees this, so check it,
since reading the code locally, it looks wrong.

Bug: 405737267
Test: N/A
Change-Id: I517ed5f69efa7be7db445f80914c0c046d8b88f9
parent d4611b21
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1609,6 +1609,8 @@ static jboolean android_os_BinderProxy_unlinkToDeath(JNIEnv* env, jobject obj,
            err = target->unlinkToDeath(origJDR, NULL, flags, &dr);
            if (err == NO_ERROR && dr != NULL) {
                sp<IBinder::DeathRecipient> sdr = dr.promote();
                LOG_ALWAYS_FATAL_IF(sdr != origJDR, "DeathRecipient mismatch, expected %p == %p",
                                    origJDR.get(), sdr.get());
                JavaDeathRecipient* jdr = static_cast<JavaDeathRecipient*>(sdr.get());
                if (jdr != NULL) {
                    jdr->clearReference();