aboutsummaryrefslogtreecommitdiff
path: root/ext/fts5/fts5_main.c
diff options
context:
space:
mode:
authordrh <>2024-11-12 13:37:00 +0000
committerdrh <>2024-11-12 13:37:00 +0000
commit92e9fa6fe887fc5cad73b4251ce06e295d7a0d2c (patch)
treed5ebf6d4bd98d2a937c35bd1a4c8b9e511dc9d2f /ext/fts5/fts5_main.c
parent7b32f84ebf5cf6ff0515a124abbc028e5890a6bc (diff)
downloadsqlite-92e9fa6fe887fc5cad73b4251ce06e295d7a0d2c.tar.gz
sqlite-92e9fa6fe887fc5cad73b4251ce06e295d7a0d2c.zip
Ensure that the sqlite3_index_info.idxStr string coming back from FTS5
is always zero-terminated, even if the xBestIndex call fails with an SQLITE_CONSTRAINT error. FossilOrigin-Name: a4e976a030851357049e672bbc0ff66d9cc152b3d5f8e03fff36a7c6f060a755
Diffstat (limited to 'ext/fts5/fts5_main.c')
-rw-r--r--ext/fts5/fts5_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c
index 5713fccdd..5c49d91b0 100644
--- a/ext/fts5/fts5_main.c
+++ b/ext/fts5/fts5_main.c
@@ -632,6 +632,7 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
if( p->usable==0 || iCol<0 ){
/* As there exists an unusable MATCH constraint this is an
** unusable plan. Return SQLITE_CONSTRAINT. */
+ idxStr[iIdxStr] = 0;
return SQLITE_CONSTRAINT;
}else{
if( iCol==nCol+1 ){