Changeset 279255 in webkit


Ignore:
Timestamp:
Jun 24, 2021, 5:06:06 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore:
Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
https://bugs.webkit.org/show_bug.cgi?id=226885

Patch by Venky Dass <yaranamavenkataramana@apple.com> on 2021-06-24
Reviewed by Sihui Liu.

Added a test to create null openDBRequest so that it can crash.

Test: storage/indexeddb/request-with-null-open-db-request.html

  • Modules/indexeddb/IDBTransaction.cpp:

(WebCore::IDBTransaction::dispatchEvent):

LayoutTests:
Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
https://bugs.webkit.org/show_bug.cgi?id=226885

Patch by Venky Dass <yaranamavenkataramana@apple.com> on 2021-06-24
Reviewed by Sihui Liu.

  • storage/indexeddb/request-with-null-open-db-request-expected.txt: Added.
  • storage/indexeddb/request-with-null-open-db-request.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r279250 r279255  
     12021-06-24  Venky Dass  <yaranamavenkataramana@apple.com>
     2
     3        Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
     4        https://bugs.webkit.org/show_bug.cgi?id=226885
     5
     6        Reviewed by Sihui Liu.
     7
     8        * storage/indexeddb/request-with-null-open-db-request-expected.txt: Added.
     9        * storage/indexeddb/request-with-null-open-db-request.html: Added.
     10
    1112021-06-24  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r279250 r279255  
     12021-06-24  Venky Dass  <yaranamavenkataramana@apple.com>
     2
     3        Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
     4        https://bugs.webkit.org/show_bug.cgi?id=226885
     5
     6        Reviewed by Sihui Liu.
     7
     8        Added a test to create null openDBRequest so that it can crash. 
     9
     10        Test: storage/indexeddb/request-with-null-open-db-request.html
     11
     12        * Modules/indexeddb/IDBTransaction.cpp:
     13        (WebCore::IDBTransaction::dispatchEvent):
     14
    1152021-06-24  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp

    r278253 r279255  
    585585        return;
    586586
     587    m_abortOrCommitEvent = event.ptr();
    587588    queueTaskToDispatchEvent(*this, TaskSource::DatabaseAccess, WTFMove(event));
    588589}
     
    595596    ASSERT(scriptExecutionContext());
    596597    ASSERT(!isContextStopped());
     598   
     599
     600    auto protectedThis = makeRef(*this);
     601
     602    EventDispatcher::dispatchEvent({ this, m_database.ptr() }, event);
     603   
     604    if (m_abortOrCommitEvent != &event)
     605        return;
     606   
    597607    ASSERT(event.type() == eventNames().completeEvent || event.type() == eventNames().abortEvent);
    598 
    599     auto protectedThis = makeRef(*this);
    600 
    601     EventDispatcher::dispatchEvent({ this, m_database.ptr() }, event);
    602608    m_didDispatchAbortOrCommit = true;
    603609
    604610    if (isVersionChange()) {
    605         ASSERT(m_openDBRequest);
    606611        m_openDBRequest->versionChangeTransactionDidFinish();
    607612
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h

    r278253 r279255  
    251251    Deque<IDBClient::TransactionOperation*> m_transactionOperationsInProgressQueue;
    252252    Deque<RefPtr<IDBClient::TransactionOperation>> m_abortQueue;
     253    Event* m_abortOrCommitEvent;
    253254    HashMap<RefPtr<IDBClient::TransactionOperation>, IDBResultData> m_transactionOperationResultMap;
    254255
Note: See TracChangeset for help on using the changeset viewer.