From 3b2f10cd8f41c837b237ee74b8b4f4147d9ef627 Mon Sep 17 00:00:00 2001 From: shess Date: Thu, 19 Apr 2007 18:36:32 +0000 Subject: [PATCH] Fix bug in fts2 handling of OR queries. When one doclist ends before the other, the code potentially tries to read past the end of the doclist. http://www.sqlite.org/cvstrac/tktview?tn=2309 (CVS 3862) FossilOrigin-Name: dfac6082e8ffc52a85c4906107a7fc0e1aa9df82 --- ext/fts2/fts2.c | 10 ++++++++-- manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/fts2g.test | 12 +++++++++++- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ext/fts2/fts2.c b/ext/fts2/fts2.c index e734d32f81..3c14e8f8bc 100644 --- a/ext/fts2/fts2.c +++ b/ext/fts2/fts2.c @@ -1374,10 +1374,16 @@ static void docListOrMerge( dlwInit(&writer, DL_DOCIDS, pOut); while( !dlrAtEnd(&left) || !dlrAtEnd(&right) ){ - if( dlrAtEnd(&right) || dlrDocid(&left)