mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Get RefPtr to transaction before using it. (DiD)
Avoid potential use-after-free by getting a RefPtr to a transaction before calling content code that could cause its de-allocation.
This commit is contained in:
parent
c0871c52e1
commit
183aae036f
1 changed files with 3 additions and 1 deletions
|
|
@ -3456,6 +3456,8 @@ BackgroundCursorChild::RecvResponse(const CursorResponse& aResponse)
|
|||
|
||||
RefPtr<IDBCursor> cursor;
|
||||
mStrongCursor.swap(cursor);
|
||||
|
||||
RefPtr<IDBTransaction> transaction = mTransaction;
|
||||
|
||||
switch (aResponse.type()) {
|
||||
case CursorResponse::Tnsresult:
|
||||
|
|
@ -3486,7 +3488,7 @@ BackgroundCursorChild::RecvResponse(const CursorResponse& aResponse)
|
|||
MOZ_CRASH("Should never get here!");
|
||||
}
|
||||
|
||||
mTransaction->OnRequestFinished(/* aActorDestroyedNormally */ true);
|
||||
transaction->OnRequestFinished(/* aActorDestroyedNormally */ true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue