aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2025-06-24 15:58:32 +0000
committerdrh <>2025-06-24 15:58:32 +0000
commit66cd200ede04bbe2c44729c3a4c55433430c4214 (patch)
tree35e5d01f8977c976b090ba7507eaccc6372f434d /src
parent513fff88c4bcb2f9e7c0427f5c6b11b96b9000a2 (diff)
downloadsqlite-66cd200ede04bbe2c44729c3a4c55433430c4214.tar.gz
sqlite-66cd200ede04bbe2c44729c3a4c55433430c4214.zip
Range check the column index on the sqlite3_preupdate_old() interface
and return SQLITE_MISUSE if too large. [forum:/forumpost/b617e497287235d0|Forum post b617e49728]. FossilOrigin-Name: 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85
Diffstat (limited to 'src')
-rw-r--r--src/vdbeapi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index f5260e7e6..02229246a 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -2192,6 +2192,9 @@ int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
}
if( p->pPk ){
iStore = sqlite3TableColumnToIndex(p->pPk, iIdx);
+ }else if( iIdx >= p->pTab->nCol ){
+ rc = SQLITE_MISUSE_BKPT;
+ goto preupdate_old_out;
}else{
iStore = sqlite3TableColumnToStorage(p->pTab, iIdx);
}