From 304cbc17c245e93a54d51225d99d821eccb3c5f5 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 13 Apr 2021 17:45:36 +0000 Subject: [PATCH] Fix an undefined signed integer overflow in fts5. FossilOrigin-Name: e6f0adb00da84561e686a8db83858c7fd6b008756dd1aef807ea68f878ca3db7 --- ext/fts5/fts5_index.c | 4 ++-- ext/fts5/test/fts5doclist.test | 21 +++++++++++++++++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index fa9c731f1a..80423e2a0d 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -4541,14 +4541,14 @@ static void fts5FlushOneHash(Fts5Index *p){ fts5BufferSafeAppendBlob(pBuf, pDoclist, nDoclist); }else{ i64 iRowid = 0; - i64 iDelta = 0; + u64 iDelta = 0; int iOff = 0; /* The entire doclist will not fit on this leaf. The following ** loop iterates through the poslists that make up the current ** doclist. */ while( p->rc==SQLITE_OK && iOff