A null compound index value crashes the Databases process.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Mar 2017 21:13:40 +0000 (21:13 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Mar 2017 21:13:40 +0000 (21:13 +0000)
commita5cefb600c124e6d396260e840efa387c23cf721
tree3166d32db3ebf929f878b752ed9c0820bc5fce19
parentc26a22168d9539f235bdc3ca28dc9ed299582e70
A null compound index value crashes the Databases process.
<rdar://problem/30499831> and https://bugs.webkit.org/show_bug.cgi?id=170000

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/single-entry-index-invalid-key-crash.html

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createKeyPathArray): Fix the bug by rejecting arrays with any invalid keys in them.

Add some logging:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::loggingString):
* Modules/indexeddb/IDBKeyPath.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString):

LayoutTests:

* storage/indexeddb/modern/resources/single-entry-index-invalid-key-crash.js: Added.
* storage/indexeddb/modern/single-entry-index-invalid-key-crash-expected.txt: Added.
* storage/indexeddb/modern/single-entry-index-invalid-key-crash-private-expected.txt: Added.
* storage/indexeddb/modern/single-entry-index-invalid-key-crash-private.html: Added.
* storage/indexeddb/modern/single-entry-index-invalid-key-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/resources/single-entry-index-invalid-key-crash.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/single-entry-index-invalid-key-crash-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/single-entry-index-invalid-key-crash-private-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/single-entry-index-invalid-key-crash-private.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/single-entry-index-invalid-key-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
Source/WebCore/Modules/indexeddb/IDBKeyPath.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp
Source/WebCore/bindings/js/IDBBindingUtilities.cpp