Commit 90438d49 authored by jsbell@chromium.org's avatar jsbell@chromium.org

IndexedDB: Crash on checking version of corrupt backing store

https://bugs.webkit.org/show_bug.cgi?id=100692

Reviewed by Tony Chang.

If the backing store fails to open (due to corruption, non-writeable disk, etc)
the subsequent schema version check dereferences a null pointer. Fix to only
do the schema check if the database opened.

Chromium tests will be included with crrev.com/11196029

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::open):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a4354cd8
2012-10-29 Joshua Bell <jsbell@chromium.org>
IndexedDB: Crash on checking version of corrupt backing store
https://bugs.webkit.org/show_bug.cgi?id=100692
Reviewed by Tony Chang.
If the backing store fails to open (due to corruption, non-writeable disk, etc)
the subsequent schema version check dereferences a null pointer. Fix to only
do the schema check if the database opened.
Chromium tests will be included with crrev.com/11196029
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::open):
2012-10-29 Philip Rogers <pdr@google.com>
Let SVGElements have pending resources.
......@@ -295,13 +295,13 @@ PassRefPtr<IDBBackingStore> IDBLevelDBBackingStore::open(SecurityOrigin* securit
String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIdentifier() + ".indexeddb.leveldb");
db = LevelDBDatabase::open(path, comparator.get());
bool knownSchema = isSchemaKnown(db.get());
if (!knownSchema) {
if (db && !isSchemaKnown(db.get())) {
LOG_ERROR("IndexedDB backing store had unknown schema, treating it as failure to open");
HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingStore.OpenStatus", IDBLevelDBBackingStoreOpenFailedUnknownSchema, IDBLevelDBBackingStoreOpenMax);
db.release();
}
if (db && knownSchema)
if (db)
HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingStore.OpenStatus", IDBLevelDBBackingStoreOpenSuccess, IDBLevelDBBackingStoreOpenMax);
else {
LOG_ERROR("IndexedDB backing store open failed, attempting cleanup");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment