| Index: third_party/sqlite/patches/0010-fts3-Disable-fts3_tokenizer-and-fts4.patch
|
| diff --git a/third_party/sqlite/patches/0010-fts3-Disable-fts3_tokenizer-and-fts4.patch b/third_party/sqlite/patches/0010-fts3-Disable-fts3_tokenizer-and-fts4.patch
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6601a54cd2ec7052e2ffe14083a76e623b055c49
|
| --- /dev/null
|
| +++ b/third_party/sqlite/patches/0010-fts3-Disable-fts3_tokenizer-and-fts4.patch
|
| @@ -0,0 +1,55 @@
|
| +From 3f3b87f36920d171ef485029b10c572da81c563a Mon Sep 17 00:00:00 2001
|
| +From: Scott Hess <shess@chromium.org>
|
| +Date: Tue, 16 Dec 2014 13:02:27 -0800
|
| +Subject: [PATCH 10/24] [fts3] Disable fts3_tokenizer and fts4.
|
| +
|
| +fts3_tokenizer allows a SQLite user to specify a pointer to call as a
|
| +function, which has obvious sercurity implications. Disable fts4 until
|
| +someone explicitly decides to own support for it.
|
| +---
|
| + third_party/sqlite/src/ext/fts3/fts3.c | 9 +++++++++
|
| + 1 file changed, 9 insertions(+)
|
| +
|
| +diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext/fts3/fts3.c
|
| +index 20da051..7accb11 100644
|
| +--- a/third_party/sqlite/src/ext/fts3/fts3.c
|
| ++++ b/third_party/sqlite/src/ext/fts3/fts3.c
|
| +@@ -291,6 +291,7 @@
|
| + ** deletions and duplications. This would basically be a forced merge
|
| + ** into a single segment.
|
| + */
|
| ++#define CHROMIUM_FTS3_CHANGES 1
|
| +
|
| + #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
| +
|
| +@@ -3646,7 +3647,11 @@ int sqlite3Fts3Init(sqlite3 *db){
|
| + ** module with sqlite.
|
| + */
|
| + if( SQLITE_OK==rc
|
| ++#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
|
| ++ /* fts3_tokenizer() disabled for security reasons. */
|
| ++#else
|
| + && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer"))
|
| ++#endif
|
| + && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1))
|
| + && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1))
|
| + && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1))
|
| +@@ -3656,11 +3661,15 @@ int sqlite3Fts3Init(sqlite3 *db){
|
| + rc = sqlite3_create_module_v2(
|
| + db, "fts3", &fts3Module, (void *)pHash, hashDestroy
|
| + );
|
| ++#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST
|
| ++ /* Disable fts4 pending review. */
|
| ++#else
|
| + if( rc==SQLITE_OK ){
|
| + rc = sqlite3_create_module_v2(
|
| + db, "fts4", &fts3Module, (void *)pHash, 0
|
| + );
|
| + }
|
| ++#endif
|
| + return rc;
|
| + }
|
| +
|
| +--
|
| +2.2.1
|
| +
|
|
|