1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

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
This commit is contained in:
drh
2024-11-12 13:37:00 +00:00
parent 7b32f84ebf
commit 92e9fa6fe8
3 changed files with 8 additions and 7 deletions

View File

@ -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 ){