From: dan Date: Sat, 31 Mar 2012 11:58:23 +0000 (+0000) Subject: Change the ICU tokenizer so that it does not attempt to call strlen(NULL). X-Git-Tag: version-3.7.12~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a25a42cfe773c71c1b92ceb6f65fb72d3aa79652;p=thirdparty%2Fsqlite.git Change the ICU tokenizer so that it does not attempt to call strlen(NULL). FossilOrigin-Name: 04298f1ac42c40cb2a48092b415acf96a08954b7 --- diff --git a/ext/fts3/fts3_icu.c b/ext/fts3/fts3_icu.c index a10a55d67b..5e9c900b09 100644 --- a/ext/fts3/fts3_icu.c +++ b/ext/fts3/fts3_icu.c @@ -110,7 +110,10 @@ static int icuOpen( *ppCursor = 0; - if( nInput<0 ){ + if( zInput==0 ){ + nInput = 0; + zInput = ""; + }else if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; diff --git a/manifest b/manifest index 0042119b0d..94e4cca145 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sin\sthe\sEXPLAIN\scode\sfor\slisting\strigger\sprograms\sthat\swas\scausing\san\sout-of-bounds\sread. -D 2012-03-31T09:59:44.574 +C Change\sthe\sICU\stokenizer\sso\sthat\sit\sdoes\snot\sattempt\sto\scall\sstrlen(NULL). +D 2012-03-31T11:58:23.752 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -70,7 +70,7 @@ F ext/fts3/fts3_aux.c 5205182bd8f372782597888156404766edf5781e F ext/fts3/fts3_expr.c dbc7ba4c3a6061adde0f38ed8e9b349568299551 F ext/fts3/fts3_hash.c 8dd2d06b66c72c628c2732555a32bc0943114914 F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec -F ext/fts3/fts3_icu.c 6c8f395cdf9e1e3afa7fadb7e523dbbf381c6dfa +F ext/fts3/fts3_icu.c 62ec177c55f6a5c6e994dd3e5fd3194b4045c347 F ext/fts3/fts3_porter.c a465b49fcb8249a755792f87516eff182efa42b3 F ext/fts3/fts3_snippet.c 51a3a34c217e24678a133782c1dfb6f2f70fe559 F ext/fts3/fts3_term.c 41e82ad335213d1c24356cf310dca1d3c13e7366 @@ -477,7 +477,7 @@ F test/fts3corrupt.test 7b0f91780ca36118d73324ec803187208ad33b32 F test/fts3corrupt2.test 6d96efae2f8a6af3eeaf283aba437e6d0e5447ba F test/fts3cov.test e0fb00d8b715ddae4a94c305992dfc3ef70353d7 F test/fts3d.test bf640d79722b720fa1c81834c48cdaa45d531b1a -F test/fts3defer.test 2ea3fa028f8d9523f9c33dd8acc4555d567ea4ac +F test/fts3defer.test 6c2707be1b05b9790ba8ff91d3391d5fb425269e F test/fts3defer2.test 35867d33ba6db03f6c73bd6f5fc333ae14f68c81 F test/fts3drop.test 1b906e293d6773812587b3dc458cb9e8f3f0c297 F test/fts3e.test 1f6c6ac9cc8b772ca256e6b22aaeed50c9350851 @@ -999,7 +999,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P f9a7e179cbbeeab5e57bbf392bef89750215546b -R ab995d275ca5429ef68a8cbbd55bb89c +P c9342ca58105499a5eb61c3e6d016559b6072c95 +R e0716dc6380f52d6136a7e11cf5bb377 U dan -Z cbd6b70420ae30df5a5f82de3e30da3c +Z be3c953a1198ae2a4c78c4ed2dd05529 diff --git a/manifest.uuid b/manifest.uuid index 8123f23dcb..de3255bc98 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c9342ca58105499a5eb61c3e6d016559b6072c95 \ No newline at end of file +04298f1ac42c40cb2a48092b415acf96a08954b7 \ No newline at end of file diff --git a/test/fts3defer.test b/test/fts3defer.test index bc50874e4a..4c8213d7f7 100644 --- a/test/fts3defer.test +++ b/test/fts3defer.test @@ -489,5 +489,39 @@ do_execsql_test 4.2 { SELECT * FROM x2 WHERE x2 MATCH 'a b c d e f g h i j k l m n o p q r s'; } {{a b c d e f g h i j k l m n o p q r s t u v w x y m}} +set tokenizers {1 simple} +ifcapable icu { lappend tokenizers 2 {icu en_US} } +foreach {tn tokenizer} $tokenizers { + do_execsql_test 5.$tn.1 " + CREATE VIRTUAL TABLE x3 USING FTS4(a, b, TOKENIZE $tokenizer) + " + do_execsql_test 5.$tn.2 { + BEGIN; + INSERT INTO x3 VALUES('b b b b b b b b b b b', 'b b b b b b b b b b b b b'); + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 SELECT * FROM x3; + INSERT INTO x3 VALUES('a b c', NULL); + INSERT INTO x3 VALUES('a x c', NULL); + COMMIT; + + SELECT * FROM x3 WHERE x3 MATCH 'a b'; + } {{a b c} {}} + + do_execsql_test 5.$tn.3 { DROP TABLE x3 } +} finish_test