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

Unified Diff: third_party/sqlite/ext/fts2/fts2.c

Issue 203046: Fix a crasher in full text search (sqlite)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/ext/fts2/fts2.c
===================================================================
--- third_party/sqlite/ext/fts2/fts2.c (revision 25929)
+++ third_party/sqlite/ext/fts2/fts2.c (working copy)
@@ -1838,7 +1838,7 @@
/* SEGDIR_MAX_INDEX */ "select max(idx) from %_segdir where level = ?",
/* SEGDIR_SET */ "insert into %_segdir values (?, ?, ?, ?, ?, ?)",
/* SEGDIR_SELECT_LEVEL */
- "select start_block, leaves_end_block, root from %_segdir "
+ "select start_block, leaves_end_block, root, idx from %_segdir "
" where level = ? order by idx",
/* SEGDIR_SPAN */
"select min(start_block), max(end_block) from %_segdir "
@@ -5287,11 +5287,14 @@
sqlite_int64 iEnd = sqlite3_column_int64(s, 1);
const char *pRootData = sqlite3_column_blob(s, 2);
int nRootData = sqlite3_column_bytes(s, 2);
+ sqlite_int64 iIndex = sqlite3_column_int64(s, 3);
/* Corrupt if we get back different types than we stored. */
+ /* Also corrupt if the index is not sequential starting at 0. */
if( sqlite3_column_type(s, 0)!=SQLITE_INTEGER ||
sqlite3_column_type(s, 1)!=SQLITE_INTEGER ||
- sqlite3_column_type(s, 2)!=SQLITE_BLOB ){
+ sqlite3_column_type(s, 2)!=SQLITE_BLOB ||
+ i != iIndex){
rc = SQLITE_CORRUPT_BKPT;
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698