diff options
author | stephan <stephan@noemail.net> | 2023-10-13 12:48:35 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-10-13 12:48:35 +0000 |
commit | 7dc0cc45f30a310dba12dcd3aaa554a146a5bf8e (patch) | |
tree | 0b4f7ed76a2f203012cdfd33965795efc25902c8 /src/main.c | |
parent | 99d43979d37b1aad05407f8b5523cfd44d9e64f3 (diff) | |
download | sqlite-7dc0cc45f30a310dba12dcd3aaa554a146a5bf8e.tar.gz sqlite-7dc0cc45f30a310dba12dcd3aaa554a146a5bf8e.zip |
Round one of an audit for SQLITE_ENABLE_API_ARMOR for functions exposed by JNI and those functions missing armor, as [forum:5e3fc453a69b49ca|reported in several forum posts].
FossilOrigin-Name: 8c25c4b18ad07861bf0e47f99f3db04b569b9b859ad0690602f748ddf3576939
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index a43afab16..4ddf7e24d 100644 --- a/src/main.c +++ b/src/main.c @@ -954,6 +954,10 @@ int sqlite3_db_cacheflush(sqlite3 *db){ int sqlite3_db_config(sqlite3 *db, int op, ...){ va_list ap; int rc; + +#ifdef SQLITE_ENABLE_API_ARMOR + if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; +#endif sqlite3_mutex_enter(db->mutex); va_start(ap, op); switch( op ){ @@ -2365,6 +2369,12 @@ void *sqlite3_preupdate_hook( void *pArg /* First callback argument */ ){ void *pRet; + +#ifdef SQLITE_ENABLE_API_ARMOR + if( db==0 || xCallback==0 ){ + return; + } +#endif sqlite3_mutex_enter(db->mutex); pRet = db->pPreUpdateArg; db->xPreUpdateCallback = xCallback; |