From 9876c1dcbf717bc6a923d2db6499bbb535a9e8f1 Mon Sep 17 00:00:00 2001 From: mazhao Date: Tue, 2 Jan 2024 11:12:35 +0800 Subject: [PATCH] fixed 54cb365 from https://gitee.com/Jeremyzz/third_party_sqlite/pulls/89 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 51d3de8..0efa996 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -212178,15 +212178,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