diff options
author | drh <drh@noemail.net> | 2014-10-24 00:35:58 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-10-24 00:35:58 +0000 |
commit | 9ca95730e3a25bf5b335ec73a0a14f0112a421fb (patch) | |
tree | 3d17fb8a23416f52cd800470fb9509d646fe2800 /src/status.c | |
parent | 4f81bbb5289cdd248c21775b9e4cdb92e110e139 (diff) | |
download | sqlite-9ca95730e3a25bf5b335ec73a0a14f0112a421fb.tar.gz sqlite-9ca95730e3a25bf5b335ec73a0a14f0112a421fb.zip |
Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in
progress and is not yet completely functional.
FossilOrigin-Name: c297a84bc678f81ffc0aa9139ab73f0ca87c1971
Diffstat (limited to 'src/status.c')
-rw-r--r-- | src/status.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c index 79a8001b8..4c2eabb66 100644 --- a/src/status.c +++ b/src/status.c @@ -86,6 +86,9 @@ int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ return SQLITE_MISUSE_BKPT; } +#ifdef SQLITE_ENABLE_API_ARMOR + if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT; +#endif *pCurrent = wsdStat.nowValue[op]; *pHighwater = wsdStat.mxValue[op]; if( resetFlag ){ @@ -105,6 +108,11 @@ int sqlite3_db_status( int resetFlag /* Reset high-water mark if true */ ){ int rc = SQLITE_OK; /* Return code */ +#ifdef SQLITE_ENABLE_API_ARMOR + if( !sqlite3SafetyCheckOk(db) || pCurrent==0|| pHighwater==0 ){ + return SQLITE_MISUSE_BKPT; + } +#endif sqlite3_mutex_enter(db->mutex); switch( op ){ case SQLITE_DBSTATUS_LOOKASIDE_USED: { |