Files
poky/meta/recipes-support/sqlite/files/CVE-2023-7104.patch
Vrushti Dabhi bf6aca4b29 sqlite3: CVE-ID correction for CVE-2023-7104
- The commit [https://sqlite.org/src/info/0e4e7a05c4204b47]
  ("Fix a buffer overread in the sessions extension that could occur when processing a corrupt changeset.")
  fixes CVE-2023-7104 instead of CVE-2022-46908.
- Hence, corrected the CVE-ID in CVE-2023-7104.patch.
- Reference: https://nvd.nist.gov/vuln/detail/CVE-2023-7104

(From OE-Core rev: 9d7f21f3d0ae24d0005076396e9a929bb32d648e)

Signed-off-by: Vrushti Dabhi <vrushti.dabhi@einfochips.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-07 05:38:17 -07:00

47 lines
1.4 KiB
Diff

From f388a0c44d2abdbd582686e511fef36c1b96ae43 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-2023-7104
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Vrushti Dabhi <vrushti.dabhi@einfochips.com>
---
sqlite3.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/sqlite3.c b/sqlite3.c
index a16db27..0b979f7 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;
}
}
}