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

Commit 719e2506 authored by Edwin Wong's avatar Edwin Wong Committed by Android (Google) Code Review
Browse files

Merge "Check scopeId size in provideKeyResponse"

parents fefac9de a9b9a30d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -356,6 +356,11 @@ Return<void> DrmPlugin::provideKeyResponse(

    Status status = Status::OK;
    bool isOfflineLicense = responseString.find(kOfflineLicense) != std::string::npos;
    if (scopeId.size() < kKeySetIdPrefix.size()) {
        android_errorWriteLog(0x534e4554, "144507096");
        _hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, hidl_vec<uint8_t>());
        return Void();
    }
    bool isRelease = (memcmp(scopeId.data(), kKeySetIdPrefix.data(), kKeySetIdPrefix.size()) == 0);
    if (isRelease) {
        keySetId.assign(scopeId.begin(), scopeId.end());