Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp

Issue 1369773004: IndexedDB: Fix null ptr crash in IDBCursor::value(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added regression layout test. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
index 3605b535c0cbd7889939a98cd10bbef4fc5e4af5..e376f6c21636cf081a3b1c7ff1a2ff1f68fe37c6 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
@@ -321,7 +321,9 @@ ScriptValue IDBCursor::value(ScriptState* scriptState)
IDBObjectStore* objectStore = effectiveObjectStore();
const IDBObjectStoreMetadata& metadata = objectStore->metadata();
IDBAny* value;
- if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
+ if (!m_value) {
+ value = IDBAny::createUndefined();
+ } else if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
RefPtr<IDBValue> idbValue = IDBValue::create(m_value.get(), m_primaryKey, metadata.keyPath);
#if ENABLE(ASSERT)
assertPrimaryKeyValidOrInjectable(scriptState, idbValue.get());

Powered by Google App Engine
This is Rietveld 408576698