IndexedDB: Protect against key prefix overflows
authoralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 23:57:21 +0000 (23:57 +0000)
committeralecflett@chromium.org <alecflett@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 23:57:21 +0000 (23:57 +0000)
commita113ace7769bf1dc6b4c286ad55ddbc701947544
treeafce702b9649e37d1c62af8419e21451b3e5a787
parentfaf8a5862b272c54b8c867adbd63b1d5529acdae
IndexedDB: Protect against key prefix overflows
https://bugs.webkit.org/show_bug.cgi?id=111138

Reviewed by Tony Chang.

Source/WebCore:

This reworks the boundary checking for all databaseId,
objectStoreId, and indexId, including negative and
zero-based ids. All entrypoints into IDBLevelDBCoding
are protected with explicit checks and all internal
uses of KeyPrefix are protected with ASSERTs in the
various constructors.

Tests: WebKit unit tests IDBBackingStoreTest.cpp in WebKit/chromium

* Modules/indexeddb/IDBBackingStore.h: Make all public methods boolean-based for errors.
* Modules/indexeddb/IDBLevelDBCoding.h: Add methods for checking databaseId, objectStoreId, and indexId.

Source/WebKit/chromium:

Add tests for invalid indexIds in basic get/put operations.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp
Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.h
Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/IDBBackingStoreTest.cpp
Source/WebKit/chromium/tests/IDBFakeBackingStore.h
Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp