diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-07 12:39:42 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-07 12:39:42 +0100 |
commit | 2b1ccf227b8f409e0572119018c7615b877a6612 (patch) | |
tree | a7928199cc3f9b144f09ab102ab6655edd50a5e3 /dom | |
parent | f8db3a89b664ce5a53a4b663daf17c70bdaf398d (diff) | |
download | UXP-2b1ccf227b8f409e0572119018c7615b877a6612.tar UXP-2b1ccf227b8f409e0572119018c7615b877a6612.tar.gz UXP-2b1ccf227b8f409e0572119018c7615b877a6612.tar.lz UXP-2b1ccf227b8f409e0572119018c7615b877a6612.tar.xz UXP-2b1ccf227b8f409e0572119018c7615b877a6612.zip |
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.
Diffstat (limited to 'dom')
-rw-r--r-- | dom/indexedDB/ActorsChild.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp index 3e8f97348..c4fcceb90 100644 --- a/dom/indexedDB/ActorsChild.cpp +++ b/dom/indexedDB/ActorsChild.cpp @@ -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; } |