mirror of
https://git.yoctoproject.org/poky
synced 2026-03-10 17:29:40 +01:00
Backport https://sqlite.org/src/info/0e4e7a05c4204b47 (From OE-Core rev: 31fb83ac3dcd2dd55b184de22a296ab4dc150d2e) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
From 09f1652f36c5c4e8a6a640ce887f9ea0f48a7958 Mon Sep 17 00:00:00 2001
|
|
From: dan <Dan Kennedy>
|
|
Date: Thu, 7 Sep 2023 13:53:09 +0000
|
|
Subject: [PATCH] Fix a buffer overread in the sessions extension that could
|
|
occur when processing a corrupt changeset.
|
|
|
|
Upstream-Status: Backport [https://sqlite.org/src/info/0e4e7a05c4204b47]
|
|
CVE: CVE-2022-46908
|
|
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
|
---
|
|
sqlite3.c | 18 +++++++++++-------
|
|
1 file changed, 11 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c
|
|
index 9f862f2465..0491549231 100644
|
|
--- a/sqlite3.c
|
|
+++ b/sqlite3.c
|
|
@@ -213482,15 +213482,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;
|
|
}
|
|
}
|
|
}
|