From e0417626ea42db7a6857bc2c5eaf8aa3c5b9237f Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 19 Mar 2015 15:52:07 +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. FossilOrigin-Name: ad4b19d2ac0889a23fe3b0fd844286efc10cdd82 --- ext/fts3/fts3.c | 9 +++++-- manifest | 14 +++++----- manifest.uuid | 2 +- test/fts3prefix.test | 64 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 10 deletions(-) diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index a31d3f13fe..3c229403b4 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