From 0bed375d9a16b172c07daacf0015b1ab7701cd13 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 20 May 2015 19:32:18 +0000 Subject: [PATCH] Silently ignore any attempt to add a prefix index for prefixes zero bytes in size to an fts3/4 table. Or any prefix index size so large that it overflows a 32-bit signed integer. Cherrypick of [ad4b19d2ac0889a2]. FossilOrigin-Name: ff7be4db8473fa850088e9b66231ba241a7543eb --- ext/fts3/fts3.c | 9 +++++-- manifest | 20 +++++++------- manifest.uuid | 2 +- test/fts3prefix.test | 64 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 14 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 4f4b667430..4ea6bf327f 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -957,7 +957,6 @@ static int fts3PrefixParameter( aIndex = sqlite3_malloc(sizeof(struct Fts3Index) * nIndex); *apIndex = aIndex; - *pnIndex = nIndex; if( !aIndex ){ return SQLITE_NOMEM; } @@ -969,11 +968,17 @@ static int fts3PrefixParameter( for(i=1; i