diff options
author | 2014-04-06 15:54:13 +0000 | |
---|---|---|
committer | 2014-04-06 15:54:13 +0000 | |
commit | 4bfc7e5fd1c14015d99a6ce5c2488b219e7e0173 (patch) | |
tree | 1dbea829151c123f9d5647aa3633c43208a3128b /lib/libsqlite3/src | |
parent | Don't suggest people use env(1) in conjunction with sudo. It is (diff) | |
download | wireguard-openbsd-4bfc7e5fd1c14015d99a6ce5c2488b219e7e0173.tar.xz wireguard-openbsd-4bfc7e5fd1c14015d99a6ce5c2488b219e7e0173.zip |
Update sqlite to 3.8.4.3. Recommended update to fix a problem that might
cause an incorrect query result and a potential buffer overread that
could corrupt a database file. Further details here:
http://sqlite.org/changes.html.
"sure ok" landry@
Diffstat (limited to 'lib/libsqlite3/src')
-rw-r--r-- | lib/libsqlite3/src/pragma.c | 6 | ||||
-rw-r--r-- | lib/libsqlite3/src/trigger.c | 2 | ||||
-rw-r--r-- | lib/libsqlite3/src/vdbe.h | 2 | ||||
-rw-r--r-- | lib/libsqlite3/src/vdbeaux.c | 1 | ||||
-rw-r--r-- | lib/libsqlite3/src/vdbeblob.c | 2 | ||||
-rw-r--r-- | lib/libsqlite3/src/where.c | 5 |
6 files changed, 12 insertions, 6 deletions
diff --git a/lib/libsqlite3/src/pragma.c b/lib/libsqlite3/src/pragma.c index a211633f231..fcecad269ab 100644 --- a/lib/libsqlite3/src/pragma.c +++ b/lib/libsqlite3/src/pragma.c @@ -824,7 +824,7 @@ void sqlite3Pragma( ** size of historical compatibility. */ case PragTyp_DEFAULT_CACHE_SIZE: { - static const int iLn = __LINE__+2; + static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList getCacheSize[] = { { OP_Transaction, 0, 0, 0}, /* 0 */ { OP_ReadCookie, 0, 1, BTREE_DEFAULT_CACHE_SIZE}, /* 1 */ @@ -1087,7 +1087,7 @@ void sqlite3Pragma( ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. */ - static const int iLn = __LINE__+2; + static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList setMeta6[] = { { OP_Transaction, 0, 1, 0}, /* 0 */ { OP_ReadCookie, 0, 1, BTREE_LARGEST_ROOT_PAGE}, @@ -1790,7 +1790,7 @@ void sqlite3Pragma( ** messages have been generated, output OK. Otherwise output the ** error message */ - static const int iLn = __LINE__+2; + static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList endCode[] = { { OP_AddImm, 1, 0, 0}, /* 0 */ { OP_IfNeg, 1, 0, 0}, /* 1 */ diff --git a/lib/libsqlite3/src/trigger.c b/lib/libsqlite3/src/trigger.c index dcbaf5d3321..01f7b21f74e 100644 --- a/lib/libsqlite3/src/trigger.c +++ b/lib/libsqlite3/src/trigger.c @@ -566,7 +566,7 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){ assert( pTable!=0 ); if( (v = sqlite3GetVdbe(pParse))!=0 ){ int base; - static const int iLn = __LINE__+2; + static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList dropTrigger[] = { { OP_Rewind, 0, ADDR(9), 0}, { OP_String8, 0, 1, 0}, /* 1 */ diff --git a/lib/libsqlite3/src/vdbe.h b/lib/libsqlite3/src/vdbe.h index 66ca602ab74..8e300b88a62 100644 --- a/lib/libsqlite3/src/vdbe.h +++ b/lib/libsqlite3/src/vdbe.h @@ -272,11 +272,13 @@ void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); # define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__) # define VdbeCoverageAlwaysTaken(v) sqlite3VdbeSetLineNumber(v,2); # define VdbeCoverageNeverTaken(v) sqlite3VdbeSetLineNumber(v,1); +# define VDBE_OFFSET_LINENO(x) (__LINE__+x) #else # define VdbeCoverage(v) # define VdbeCoverageIf(v,x) # define VdbeCoverageAlwaysTaken(v) # define VdbeCoverageNeverTaken(v) +# define VDBE_OFFSET_LINENO(x) 0 #endif #endif diff --git a/lib/libsqlite3/src/vdbeaux.c b/lib/libsqlite3/src/vdbeaux.c index a641a72ec8e..96fd4016dad 100644 --- a/lib/libsqlite3/src/vdbeaux.c +++ b/lib/libsqlite3/src/vdbeaux.c @@ -3432,6 +3432,7 @@ int sqlite3VdbeRecordCompare( }else{ idx1 = getVarint32(aKey1, szHdr1); d1 = szHdr1; + if( d1>(unsigned)nKey1 ) return 1; /* Corruption */ i = 0; } diff --git a/lib/libsqlite3/src/vdbeblob.c b/lib/libsqlite3/src/vdbeblob.c index 4b34f2c2957..cf7495e5b4f 100644 --- a/lib/libsqlite3/src/vdbeblob.c +++ b/lib/libsqlite3/src/vdbeblob.c @@ -133,7 +133,7 @@ int sqlite3_blob_open( ** which closes the b-tree cursor and (possibly) commits the ** transaction. */ - static const int iLn = __LINE__+4; + static const int iLn = VDBE_OFFSET_LINENO(4); static const VdbeOpList openBlob[] = { /* {OP_Transaction, 0, 0, 0}, // 0: Inserted separately */ {OP_TableLock, 0, 0, 0}, /* 1: Acquire a read or write lock */ diff --git a/lib/libsqlite3/src/where.c b/lib/libsqlite3/src/where.c index 963878d0094..d8389a4d699 100644 --- a/lib/libsqlite3/src/where.c +++ b/lib/libsqlite3/src/where.c @@ -3974,7 +3974,10 @@ static int whereLoopAddBtreeIndex( pNew->aLTerm[pNew->nLTerm++] = 0; pNew->wsFlags |= WHERE_SKIPSCAN; nIter = sqlite3LogEst(pProbe->aiRowEst[0]/pProbe->aiRowEst[saved_nEq+1]); + pNew->rRun = rLogSize + nIter; + pNew->nOut += nIter; whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter); + pNew->nOut = saved_nOut; } for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ int nIn = 0; @@ -5877,7 +5880,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ for(; k<last; k++, pOp++){ if( pOp->p1!=pLevel->iTabCur ) continue; if( pOp->opcode==OP_Column ){ - pOp->opcode = OP_SCopy; + pOp->opcode = OP_Copy; pOp->p1 = pOp->p2 + pTabItem->regResult; pOp->p2 = pOp->p3; pOp->p3 = 0; |