aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-01-25 14:38:19 +0000
committerdrh <drh@noemail.net>2017-01-25 14:38:19 +0000
commit7888d14caa853827e60bac132ffcb0c6b25036c8 (patch)
tree40e7323919410560302c87cc45dfef54a4aaf54a /src
parent666d34c791536557855c3efd58a9a1c3ec7e59a0 (diff)
parent210b0d0eb311e2fc2ece5c71a196811479f5f349 (diff)
downloadsqlite-7888d14caa853827e60bac132ffcb0c6b25036c8.tar.gz
sqlite-7888d14caa853827e60bac132ffcb0c6b25036c8.zip
Ensure that sqlite3_blob_reopen() correctly handles short rows.
Fix for ticket [e6e962d6b0f06f46e]. FossilOrigin-Name: 8cd1a4451cce1fe28f462800e2be1dee1735c0d0
Diffstat (limited to 'src')
-rw-r--r--src/vdbeblob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index 1efd4c924..810f78860 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -77,7 +77,9 @@ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
}
if( rc==SQLITE_ROW ){
VdbeCursor *pC = v->apCsr[0];
- u32 type = pC->aType[p->iCol];
+ u32 type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0;
+ testcase( pC->nHdrParsed==p->iCol );
+ testcase( pC->nHdrParsed==p->iCol+1 );
if( type<12 ){
zErr = sqlite3MPrintf(p->db, "cannot open value of type %s",
type==0?"null": type==7?"real": "integer"