From 54cb365745a0cc365504ab72e33bf54b617dd322 Mon Sep 17 00:00:00 2001 From: mazhao Date: Tue, 2 Jan 2024 11:12:35 +0800 Subject: [PATCH] Fix bug Signed-off-by: mazhao --- src/sqlite3.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/sqlite3.c b/src/sqlite3.c index d3e7fb2..8ca1d92 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -218352,15 +218352,19 @@ static int sessionReadRecord( } } if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ - sqlite3_int64 v = sessionGetI64(aVal); - if( eType==SQLITE_INTEGER ){ - sqlite3VdbeMemSetInt64(apOut[i], v); + if( (pIn->nData-pIn->iNext)<8 ){ + rc = SQLITE_CORRUPT_BKPT; }else{ - double d; - memcpy(&d, &v, 8); - sqlite3VdbeMemSetDouble(apOut[i], d); + sqlite3_int64 v = sessionGetI64(aVal); + if( eType==SQLITE_INTEGER ){ + sqlite3VdbeMemSetInt64(apOut[i], v); + }else{ + double d; + memcpy(&d, &v, 8); + sqlite3VdbeMemSetDouble(apOut[i], d); + } + pIn->iNext += 8; } - pIn->iNext += 8; } } } -- Gitee