aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeblob.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-02-21 15:13:50 +0000
committerdrh <drh@noemail.net>2015-02-21 15:13:50 +0000
commit878acb32efa879e0b680cce08f63e65f89fa4f77 (patch)
tree84f334c6f75c248e10f9a92c17e3dae631f2c597 /src/vdbeblob.c
parent1ee4a2dd88663517c8dd980926af9e76f37c88fb (diff)
parent2da47d38691b74a6cfa2ce2e5bdce3bb7d8fc186 (diff)
downloadsqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.tar.gz
sqlite-878acb32efa879e0b680cce08f63e65f89fa4f77.zip
Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: f36bb5fa5c5e3430808fe35d58f45559a216d341
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r--src/vdbeblob.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index 4061e9780..522213a0b 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -156,12 +156,17 @@ int sqlite3_blob_open(
Incrblob *pBlob = 0;
#ifdef SQLITE_ENABLE_API_ARMOR
- if( !sqlite3SafetyCheckOk(db) || ppBlob==0 || zTable==0 ){
+ if( ppBlob==0 ){
return SQLITE_MISUSE_BKPT;
}
#endif
- flags = !!flags; /* flags = (flags ? 1 : 0); */
*ppBlob = 0;
+#ifdef SQLITE_ENABLE_API_ARMOR
+ if( !sqlite3SafetyCheckOk(db) || zTable==0 ){
+ return SQLITE_MISUSE_BKPT;
+ }
+#endif
+ flags = !!flags; /* flags = (flags ? 1 : 0); */
sqlite3_mutex_enter(db->mutex);
@@ -377,7 +382,7 @@ static int blobReadWrite(
sqlite3_mutex_enter(db->mutex);
v = (Vdbe*)p->pStmt;
- if( n<0 || iOffset<0 || (iOffset+n)>p->nByte ){
+ if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){
/* Request is out of range. Return a transient error. */
rc = SQLITE_ERROR;
}else if( v==0 ){