1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

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
This commit is contained in:
drh
2025-06-24 15:58:32 +00:00
parent 513fff88c4
commit 66cd200ede
4 changed files with 17 additions and 9 deletions

View File

@@ -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);
}