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

Commit d286af0b authored by Alexey Polyudov's avatar Alexey Polyudov Committed by Android (Google) Code Review
Browse files

Merge "gatekeeperd: protect from invalid data passed by HAL" into nyc-mr2-dev

parents 6c533a7f 8c63536d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -169,7 +169,14 @@ public:
                    enrolled_password_handle, enrolled_password_handle_length);
        }

        if (ret == 0) {
        if (ret == GATEKEEPER_RESPONSE_OK && (*enrolled_password_handle == nullptr ||
            *enrolled_password_handle_length != sizeof(password_handle_t))) {
            ret = GATEKEEPER_RESPONSE_ERROR;
            ALOGE("HAL: password_handle=%p size_of_handle=%" PRIu32 "\n",
                  *enrolled_password_handle, *enrolled_password_handle_length);
        }

        if (ret == GATEKEEPER_RESPONSE_OK) {
            gatekeeper::password_handle_t *handle =
                    reinterpret_cast<gatekeeper::password_handle_t *>(*enrolled_password_handle);
            store_sid(uid, handle->user_id);