From 9c447b199f203ffd0ae03c8849938ebc5706e02b Mon Sep 17 00:00:00 2001 From: wbq_sky Date: Fri, 12 Aug 2022 20:34:15 +0800 Subject: [PATCH] fix the cve-2022-35737 Signed-off-by: wbq_sky Change-Id: I37962ff4b5717dc75b2ceaecd5fa78b8e7a692f9 --- src/sqlite3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sqlite3.c b/src/sqlite3.c index 83a4040..127d868 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -152425,7 +152425,7 @@ static int whereKeyStats( #endif assert( pRec!=0 ); assert( pIdx->nSample>0 ); - assert( pRec->nField>0 && pRec->nField<=pIdx->nSampleCol ); + assert( pRec->nField>0 ); /* Do a binary search to find the first sample greater than or equal ** to pRec. If pRec contains a single field, the set of samples to search @@ -152471,7 +152471,7 @@ static int whereKeyStats( ** it is extended to two fields. The duplicates that this creates do not ** cause any problems. */ - nField = pRec->nField; + nField = MIN(pRec->nField, pIdx->nSample); iCol = 0; iSample = pIdx->nSample * nField; do{ -- Gitee