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

Commit a1d401d9 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Check all server-provided sp<IMemory>

If the sp<IMemory> from server is non-0, make sure it also has
a non-NULL pointer().   If it is NULL, treat it as if the sp<> was 0.

Change-Id: I6d0bd786587eb73fac38af787c11eba541880685
parent e75da400
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ public:
        status_t status = remote()->transact(GET_CBLK, data, &reply);
        if (status == NO_ERROR) {
            cblk = interface_cast<IMemory>(reply.readStrongBinder());
            if (cblk != 0 && cblk->pointer() == NULL) {
                cblk.clear();
            }
        }
        return cblk;
    }
+6 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ public:
        status_t status = remote()->transact(GET_CBLK, data, &reply);
        if (status == NO_ERROR) {
            cblk = interface_cast<IMemory>(reply.readStrongBinder());
            if (cblk != 0 && cblk->pointer() == NULL) {
                cblk.clear();
            }
        }
        return cblk;
    }
@@ -122,6 +125,9 @@ public:
            status = reply.readInt32();
            if (status == NO_ERROR) {
                *buffer = interface_cast<IMemory>(reply.readStrongBinder());
                if (*buffer != 0 && (*buffer)->pointer() == NULL) {
                    (*buffer).clear();
                }
            }
        }
        return status;
+3 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ public:
        status_t status = remote()->transact(GET_CBLK, data, &reply);
        if (status == NO_ERROR) {
            cblk = interface_cast<IMemory>(reply.readStrongBinder());
            if (cblk != 0 && cblk->pointer() == NULL) {
                cblk.clear();
            }
        }
        return cblk;
    }