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/mutex_unix.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/mutex_unix.c')
-rw-r--r-- | src/mutex_unix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mutex_unix.c b/src/mutex_unix.c index c8663144e..c936914d8 100644 --- a/src/mutex_unix.c +++ b/src/mutex_unix.c @@ -175,8 +175,12 @@ static sqlite3_mutex *pthreadMutexAlloc(int iType){ break; } default: { - assert( iType-2 >= 0 ); - assert( iType-2 < ArraySize(staticMutexes) ); +#ifdef SQLITE_ENABLE_API_ARMOR + if( iType-2<0 || iType-2>=ArraySize(staticMutexes) ){ + (void)SQLITE_MISUSE_BKPT; + return 0; + } +#endif p = &staticMutexes[iType-2]; #if SQLITE_MUTEX_NREF p->id = iType; |