From 9ea258d712123c8e492313f7f45c248af6978d17 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 16 May 2017 09:49:42 +0000 Subject: [PATCH 1/6] Update the tool/warnings.sh script to automatically use the right options on OpenBSD.. FossilOrigin-Name: 7940bff32aa6ea868a53680822d148b7ec7a075c01ae9e0d5ad9859bcc339054 --- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/warnings.sh | 16 +++++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 954fc9afcc..e49d285261 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sbuild\sso\sthat\sit\sworks\sagain\swith\sSQLITE_OMIT_SUBQUERY. -D 2017-05-15T15:12:24.562 +C Update\sthe\stool/warnings.sh\sscript\sto\sautomatically\suse\sthe\sright\soptions\son\sOpenBSD.. +D 2017-05-16T09:49:42.023 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -1557,7 +1557,7 @@ F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003 F tool/vdbe-compress.tcl 5926c71f9c12d2ab73ef35c29376e756eb68361c F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 -F tool/warnings.sh d9ded5274b3cb947e98e70d587f71d6263f803b5 +F tool/warnings.sh 8a4acea31e0f9c562949a2d767329533c0930d699ea19c6704c0ca0aa9154068 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F vsixtest/App.xaml b76d3b48860e7454775c47ea38ffea9c4abe3e85 F vsixtest/App.xaml.cpp c465147f50871165c60ca16955219f6c5812d6d8 @@ -1580,7 +1580,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0f05d7e93a73bbeac0a09bbd614287507355a7d75fc7b98729bcf7607fc8e125 -R a9e25308f45891c9b24063503aeca595 -U drh -Z 8c1e0c69d71e5343091b9dc46bca8976 +P bb0d9281588b8cc24bf2f1f10d0c56277004226adaa2ce5037782503b283b45d +R 0af7da97ec99dfdc47acd61562c849dd +U dan +Z 1c514bbb65da185a2b54f96dcba53c59 diff --git a/manifest.uuid b/manifest.uuid index de1332e1c2..23df76dc03 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bb0d9281588b8cc24bf2f1f10d0c56277004226adaa2ce5037782503b283b45d \ No newline at end of file +7940bff32aa6ea868a53680822d148b7ec7a075c01ae9e0d5ad9859bcc339054 \ No newline at end of file diff --git a/tool/warnings.sh b/tool/warnings.sh index ae40cfb1ae..e9ffad44e0 100644 --- a/tool/warnings.sh +++ b/tool/warnings.sh @@ -4,13 +4,15 @@ # compiler warnings in SQLite. # -# Use these for testing on Linux and Mac OSX: -WARNING_OPTS="-Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long" -WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra" - -# Use these for testing on OpenBSD: -# WARNING_OPTS=-Wall -# WARNING_ANDROID_OPTS=-Wall +if uname | grep -i openbsd ; then + # Use these for testing on OpenBSD: + WARNING_OPTS=-Wall + WARNING_ANDROID_OPTS=-Wall +else + # Use these for testing on Linux and Mac OSX: + WARNING_OPTS="-Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long" + WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra" +fi rm -f sqlite3.c make sqlite3.c From 22025ef1984c4f3f3774f0e4b232d0166f55d458 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 19 May 2017 12:32:32 +0000 Subject: [PATCH 2/6] Fix some problems in fts5 code detected by -fsanitize=undefined. FossilOrigin-Name: 35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d --- ext/fts5/fts5_buffer.c | 12 ++++---- ext/fts5/fts5_hash.c | 65 ++++++++++++++++++++++++------------------ ext/fts5/fts5_index.c | 6 ++-- manifest | 16 +++++------ manifest.uuid | 2 +- 5 files changed, 56 insertions(+), 45 deletions(-) diff --git a/ext/fts5/fts5_buffer.c b/ext/fts5/fts5_buffer.c index 0098846be9..b11689745b 100644 --- a/ext/fts5/fts5_buffer.c +++ b/ext/fts5/fts5_buffer.c @@ -67,9 +67,11 @@ void sqlite3Fts5BufferAppendBlob( const u8 *pData ){ assert_nc( *pRc || nData>=0 ); - if( fts5BufferGrow(pRc, pBuf, nData) ) return; - memcpy(&pBuf->p[pBuf->n], pData, nData); - pBuf->n += nData; + if( nData ){ + if( fts5BufferGrow(pRc, pBuf, nData) ) return; + memcpy(&pBuf->p[pBuf->n], pData, nData); + pBuf->n += nData; + } } /* @@ -246,8 +248,8 @@ void *sqlite3Fts5MallocZero(int *pRc, int nByte){ void *pRet = 0; if( *pRc==SQLITE_OK ){ pRet = sqlite3_malloc(nByte); - if( pRet==0 && nByte>0 ){ - *pRc = SQLITE_NOMEM; + if( pRet==0 ){ + if( nByte>0 ) *pRc = SQLITE_NOMEM; }else{ memset(pRet, 0, nByte); } diff --git a/ext/fts5/fts5_hash.c b/ext/fts5/fts5_hash.c index afa2a30739..1327597ce7 100644 --- a/ext/fts5/fts5_hash.c +++ b/ext/fts5/fts5_hash.c @@ -36,9 +36,10 @@ struct Fts5Hash { /* ** Each entry in the hash table is represented by an object of the -** following type. Each object, its key (zKey[]) and its current data -** are stored in a single memory allocation. The position list data -** immediately follows the key data in memory. +** following type. Each object, its key (a nul-terminated string) and +** its current data are stored in a single memory allocation. The +** key immediately follows the object in memory. The position list +** data immediately follows the key data in memory. ** ** The data that follows the key is in a similar, but not identical format ** to the doclist data stored in the database. It is: @@ -62,20 +63,20 @@ struct Fts5HashEntry { int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ - int nKey; /* Length of zKey[] in bytes */ + int nKey; /* Length of key in bytes */ u8 bDel; /* Set delete-flag @ iSzPoslist */ u8 bContent; /* Set content-flag (detail=none mode) */ i16 iCol; /* Column of last value written */ int iPos; /* Position of last value written */ i64 iRowid; /* Rowid of last value written */ - char zKey[8]; /* Nul-terminated entry key */ }; /* -** Size of Fts5HashEntry without the zKey[] array. +** Eqivalent to: +** +** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ -#define FTS5_HASHENTRYSIZE (sizeof(Fts5HashEntry)-8) - +#define fts5EntryKey(p) ( ((char *)(&(p)[1])) ) /* @@ -173,7 +174,7 @@ static int fts5HashResize(Fts5Hash *pHash){ int iHash; Fts5HashEntry *p = apOld[i]; apOld[i] = p->pHashNext; - iHash = fts5HashKey(nNew, (u8*)p->zKey, (int)strlen(p->zKey)); + iHash = fts5HashKey(nNew, (u8*)fts5EntryKey(p), strlen(fts5EntryKey(p))); p->pHashNext = apNew[iHash]; apNew[iHash] = p; } @@ -244,9 +245,10 @@ int sqlite3Fts5HashWrite( /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ - if( p->zKey[0]==bByte + char *zKey = fts5EntryKey(p); + if( zKey[0]==bByte && p->nKey==nToken - && memcmp(&p->zKey[1], pToken, nToken)==0 + && memcmp(&zKey[1], pToken, nToken)==0 ){ break; } @@ -255,7 +257,8 @@ int sqlite3Fts5HashWrite( /* If an existing hash entry cannot be found, create a new one. */ if( p==0 ){ /* Figure out how much space to allocate */ - int nByte = FTS5_HASHENTRYSIZE + (nToken+1) + 1 + 64; + char *zKey; + int nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64; if( nByte<128 ) nByte = 128; /* Grow the Fts5Hash.aSlot[] array if necessary. */ @@ -268,14 +271,15 @@ int sqlite3Fts5HashWrite( /* Allocate new Fts5HashEntry and add it to the hash table. */ p = (Fts5HashEntry*)sqlite3_malloc(nByte); if( !p ) return SQLITE_NOMEM; - memset(p, 0, FTS5_HASHENTRYSIZE); + memset(p, 0, sizeof(Fts5HashEntry)); p->nAlloc = nByte; - p->zKey[0] = bByte; - memcpy(&p->zKey[1], pToken, nToken); - assert( iHash==fts5HashKey(pHash->nSlot, (u8*)p->zKey, nToken+1) ); + zKey = fts5EntryKey(p); + zKey[0] = bByte; + memcpy(&zKey[1], pToken, nToken); + assert( iHash==fts5HashKey(pHash->nSlot, (u8*)zKey, nToken+1) ); p->nKey = nToken; - p->zKey[nToken+1] = '\0'; - p->nData = nToken+1 + 1 + FTS5_HASHENTRYSIZE; + zKey[nToken+1] = '\0'; + p->nData = nToken+1 + 1 + sizeof(Fts5HashEntry); p->pHashNext = pHash->aSlot[iHash]; pHash->aSlot[iHash] = p; pHash->nEntry++; @@ -393,9 +397,11 @@ static Fts5HashEntry *fts5HashEntryMerge( p1 = 0; }else{ int i = 0; - while( p1->zKey[i]==p2->zKey[i] ) i++; + char *zKey1 = fts5EntryKey(p1); + char *zKey2 = fts5EntryKey(p2); + while( zKey1[i]==zKey2[i] ) i++; - if( ((u8)p1->zKey[i])>((u8)p2->zKey[i]) ){ + if( ((u8)zKey1[i])>((u8)zKey2[i]) ){ /* p2 is smaller */ *ppOut = p2; ppOut = &p2->pScanNext; @@ -438,7 +444,7 @@ static int fts5HashEntrySort( for(iSlot=0; iSlotnSlot; iSlot++){ Fts5HashEntry *pIter; for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ - if( pTerm==0 || 0==memcmp(pIter->zKey, pTerm, nTerm) ){ + if( pTerm==0 || 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm) ){ Fts5HashEntry *pEntry = pIter; pEntry->pScanNext = 0; for(i=0; ap[i]; i++){ @@ -471,16 +477,18 @@ int sqlite3Fts5HashQuery( int *pnDoclist /* OUT: Size of doclist in bytes */ ){ unsigned int iHash = fts5HashKey(pHash->nSlot, (const u8*)pTerm, nTerm); + char *zKey; Fts5HashEntry *p; for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ - if( memcmp(p->zKey, pTerm, nTerm)==0 && p->zKey[nTerm]==0 ) break; + zKey = fts5EntryKey(p); + if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break; } if( p ){ fts5HashAddPoslistSize(pHash, p); - *ppDoclist = (const u8*)&p->zKey[nTerm+1]; - *pnDoclist = p->nData - (FTS5_HASHENTRYSIZE + nTerm + 1); + *ppDoclist = (const u8*)&zKey[nTerm+1]; + *pnDoclist = p->nData - (sizeof(Fts5HashEntry) + nTerm + 1); }else{ *ppDoclist = 0; *pnDoclist = 0; @@ -513,11 +521,12 @@ void sqlite3Fts5HashScanEntry( ){ Fts5HashEntry *p; if( (p = pHash->pScan) ){ - int nTerm = (int)strlen(p->zKey); + char *zKey = fts5EntryKey(p); + int nTerm = (int)strlen(zKey); fts5HashAddPoslistSize(pHash, p); - *pzTerm = p->zKey; - *ppDoclist = (const u8*)&p->zKey[nTerm+1]; - *pnDoclist = p->nData - (FTS5_HASHENTRYSIZE + nTerm + 1); + *pzTerm = zKey; + *ppDoclist = (const u8*)&zKey[nTerm+1]; + *pnDoclist = p->nData - (sizeof(Fts5HashEntry) + nTerm + 1); }else{ *pzTerm = 0; *ppDoclist = 0; diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index 6dc9f8470e..7b13718ee0 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -5093,7 +5093,7 @@ static void fts5SetupPrefixIter( if( pData ){ pData->p = (u8*)&pData[1]; pData->nn = pData->szLeaf = doclist.n; - memcpy(pData->p, doclist.p, doclist.n); + if( doclist.n ) memcpy(pData->p, doclist.p, doclist.n); fts5MultiIterNew2(p, pData, bDesc, ppIter); } fts5BufferFree(&doclist); @@ -5332,7 +5332,7 @@ int sqlite3Fts5IndexQuery( if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ int iIdx = 0; /* Index to search */ - memcpy(&buf.p[1], pToken, nToken); + if( nToken ) memcpy(&buf.p[1], pToken, nToken); /* Figure out which index to search and set iIdx accordingly. If this ** is a prefix query for which there is no prefix index, set iIdx to @@ -5381,7 +5381,7 @@ int sqlite3Fts5IndexQuery( } if( p->rc ){ - sqlite3Fts5IterClose(&pRet->base); + sqlite3Fts5IterClose((Fts5IndexIter*)pRet); pRet = 0; fts5CloseReader(p); } diff --git a/manifest b/manifest index e49d285261..c4c9173c64 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\stool/warnings.sh\sscript\sto\sautomatically\suse\sthe\sright\soptions\son\sOpenBSD.. -D 2017-05-16T09:49:42.023 +C Fix\ssome\sproblems\sin\sfts5\scode\sdetected\sby\s-fsanitize=undefined. +D 2017-05-19T12:32:32.722 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -101,11 +101,11 @@ F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0 F ext/fts5/fts5.h 62f3e33ceeb9a428db139f9c012186b371da1cc7 F ext/fts5/fts5Int.h 15e7514b46a845937d7c62e5c69e935091f0dbb72eb61aa4c8bcfbd39fdea158 F ext/fts5/fts5_aux.c 67acf8d51723cf28ffc3828210ba662df4b8d267 -F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd +F ext/fts5/fts5_buffer.c 1dd1ec0446b3acfc2d7d407eb894762a461613e2695273f48e449bfd13e973ff F ext/fts5/fts5_config.c 5af9c360e99669d29f06492c370892394aba0857 F ext/fts5/fts5_expr.c f2825f714d91bbe62ab5820aee9ad12e0c94205b2a01725eaa9072415ae9ff1c -F ext/fts5/fts5_hash.c 880998e596b60f078348d48732ca4ad9a90caad2 -F ext/fts5/fts5_index.c 9ce10106f42f8b84278a8ea859940224e2af5f0cc882f909364469f6f52769cb +F ext/fts5/fts5_hash.c 534d5591f479c0999543689122ad6952823bc7c85273a0ff4f7f91d9f914a54b +F ext/fts5/fts5_index.c cdceac47287c66500214ee946ca871ac48027a82a0ca82177c1c6af19f181ca0 F ext/fts5/fts5_main.c 1ba0e7806886c1bc16e20d0dde1c2b535d1aeb98cbbb937c4c3e064af5ac6f03 F ext/fts5/fts5_storage.c 7750986004f3f0c94619a85ecb5dd6cbef53e5e3853488e8a906c269d4d11db6 F ext/fts5/fts5_tcl.c 4a901f00c8553740dba63511603f5527d741c26a @@ -1580,7 +1580,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P bb0d9281588b8cc24bf2f1f10d0c56277004226adaa2ce5037782503b283b45d -R 0af7da97ec99dfdc47acd61562c849dd +P 7940bff32aa6ea868a53680822d148b7ec7a075c01ae9e0d5ad9859bcc339054 +R 43b2f6640d15533e1a63dfe250cd3268 U dan -Z 1c514bbb65da185a2b54f96dcba53c59 +Z f9fce9521e2a47d8f39c7a8284ffa988 diff --git a/manifest.uuid b/manifest.uuid index 23df76dc03..cee88ede1d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7940bff32aa6ea868a53680822d148b7ec7a075c01ae9e0d5ad9859bcc339054 \ No newline at end of file +35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d \ No newline at end of file From 8c3bde05ce4da421bd409af806f66a7f0de53e48 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 19 May 2017 20:46:27 +0000 Subject: [PATCH 3/6] Branch for the 3.19 release. FossilOrigin-Name: f2b829ec52c2037eba4feb9427c56d84aca736cb5fc841dfe91cfff22cf660c1 --- manifest | 13 ++++++++----- manifest.uuid | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/manifest b/manifest index c4c9173c64..d17b17216d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\sproblems\sin\sfts5\scode\sdetected\sby\s-fsanitize=undefined. -D 2017-05-19T12:32:32.722 +C Branch\sfor\sthe\s3.19\srelease. +D 2017-05-19T20:46:27.662 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -1580,7 +1580,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 7940bff32aa6ea868a53680822d148b7ec7a075c01ae9e0d5ad9859bcc339054 +P 35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d R 43b2f6640d15533e1a63dfe250cd3268 -U dan -Z f9fce9521e2a47d8f39c7a8284ffa988 +T *branch * branch-3.19 +T *sym-branch-3.19 * +T -sym-trunk * +U drh +Z a733288d67c031dc7d9d7d304f469f22 diff --git a/manifest.uuid b/manifest.uuid index cee88ede1d..dc4e892a2d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d \ No newline at end of file +f2b829ec52c2037eba4feb9427c56d84aca736cb5fc841dfe91cfff22cf660c1 \ No newline at end of file From d8025e43ae7ea99f844e595377a1dd4c3b1618a4 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 19 May 2017 23:04:04 +0000 Subject: [PATCH 4/6] Prevent a possible NULL pointer dereference in the OP_Found opcode that can follow an OOM error. Problem found by OSS-Fuzz. FossilOrigin-Name: 50ad60ded54aa22dfdf519ed5da6451de790e22a972ff299f7976fbdce7a0579 --- manifest | 16 +++++++--------- manifest.uuid | 2 +- src/vdbe.c | 6 ++++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index d17b17216d..7b0500a7ac 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Branch\sfor\sthe\s3.19\srelease. -D 2017-05-19T20:46:27.662 +C Prevent\sa\spossible\sNULL\spointer\sdereference\sin\sthe\sOP_Found\sopcode\sthat\ncan\sfollow\san\sOOM\serror.\s\sProblem\sfound\sby\sOSS-Fuzz. +D 2017-05-19T23:04:04.031 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -470,7 +470,7 @@ F src/update.c c443935c652af9365e033f756550b5032d02e1b06eb2cb890ed7511ae0c051dc F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/util.c fc081ec6f63448dcd80d3dfad35baecfa104823254a815b081a4d9fe76e1db23 F src/vacuum.c 1fe4555cd8c9b263afb85b5b4ee3a4a4181ad569 -F src/vdbe.c 9bac2bc2313ed682e6f48ccff6644d3263341885bfcbb3cdea7b720c722be2d5 +F src/vdbe.c b24b9806db72ad02ca82263b4705150fe9a547508948ee9906b7e120d3710211 F src/vdbe.h f7d1456e28875c2dcb964056589b5b7149ab7edf39edeca801596a39bb3d3848 F src/vdbeInt.h 1ecdacc1322fdd3241ec30c32a480e328a6f864e532dc53fae8e0ab68121aebf F src/vdbeapi.c dc904b3c5e459727993c2421e653e29d63223846d129fae98adc782b0a996481 @@ -1580,10 +1580,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d -R 43b2f6640d15533e1a63dfe250cd3268 -T *branch * branch-3.19 -T *sym-branch-3.19 * -T -sym-trunk * +P f2b829ec52c2037eba4feb9427c56d84aca736cb5fc841dfe91cfff22cf660c1 +Q +c2de178fe7e2e4e0d764e7e6ac637cfc8c053580c43f7246318dafad2974de3c +R fa3de8848fde01ec07b6ff80f323523f U drh -Z a733288d67c031dc7d9d7d304f469f22 +Z 8ada4e4e3a5f42b8890ba86493cb429e diff --git a/manifest.uuid b/manifest.uuid index dc4e892a2d..bf1abc06e9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f2b829ec52c2037eba4feb9427c56d84aca736cb5fc841dfe91cfff22cf660c1 \ No newline at end of file +50ad60ded54aa22dfdf519ed5da6451de790e22a972ff299f7976fbdce7a0579 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index e6c964245f..495cec2191 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -4106,10 +4106,12 @@ case OP_Found: { /* jump, in3 */ pIdxKey = &r; pFree = 0; }else{ + assert( pIn3->flags & MEM_Blob ); + rc = ExpandBlob(pIn3); + assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); + if( rc ) goto no_mem; pFree = pIdxKey = sqlite3VdbeAllocUnpackedRecord(pC->pKeyInfo); if( pIdxKey==0 ) goto no_mem; - assert( pIn3->flags & MEM_Blob ); - (void)ExpandBlob(pIn3); sqlite3VdbeRecordUnpack(pC->pKeyInfo, pIn3->n, pIn3->z, pIdxKey); } pIdxKey->default_rc = 0; From 44ec1d6edaac87ed3470980c884ba609c1f2d2dd Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 22 May 2017 13:06:45 +0000 Subject: [PATCH 5/6] Include the "msvc.h" header file in the amalgamation tarball. FossilOrigin-Name: 3dd6fe53c7ae6ebe2393e956d040e00b8cd0589674d20aafe1585aaa61325bbe --- autoconf/Makefile.am | 2 +- manifest | 15 +++++++-------- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoconf/Makefile.am b/autoconf/Makefile.am index e8211596d9..a1d8f59efd 100644 --- a/autoconf/Makefile.am +++ b/autoconf/Makefile.am @@ -12,7 +12,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -include_HEADERS = sqlite3.h sqlite3ext.h +include_HEADERS = sqlite3.h sqlite3ext.h msvc.h EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs pkgconfigdir = ${libdir}/pkgconfig diff --git a/manifest b/manifest index 7b0500a7ac..c8d1cd13f7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Prevent\sa\spossible\sNULL\spointer\sdereference\sin\sthe\sOP_Found\sopcode\sthat\ncan\sfollow\san\sOOM\serror.\s\sProblem\sfound\sby\sOSS-Fuzz. -D 2017-05-19T23:04:04.031 +C Include\sthe\s"msvc.h"\sheader\sfile\sin\sthe\samalgamation\starball. +D 2017-05-22T13:06:45.288 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -10,7 +10,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 -F autoconf/Makefile.am 1a47d071e3d5435f8f7ebff7eb6703848bbd65d4 +F autoconf/Makefile.am ed95854f5df64c1d0a447d8ecb55edc67e3c32f79f597c3a4870f9ac51698275 F autoconf/Makefile.msc 1014be616b420a5f48611d21b62ca2f50ec97ee795087ecb8a4d6bf6375ba11d F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1 @@ -1512,7 +1512,7 @@ F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 -F tool/mkautoconfamal.sh e855df211ecbcc7131dee817110ff386cfb112f7 +F tool/mkautoconfamal.sh ab527af92dc684028e0d1db3fa6241787fae78987b99e5bbac7eb87e1970b8e5 F tool/mkkeywordhash.c f7f3b342211ac6a14258b9726d5b97cf4f548f22 F tool/mkmsvcmin.tcl cbd93f1cfa3a0a9ae56fc958510aa3fc3ac65e29cb111716199e3d0e66eefaa4 F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c @@ -1580,8 +1580,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P f2b829ec52c2037eba4feb9427c56d84aca736cb5fc841dfe91cfff22cf660c1 -Q +c2de178fe7e2e4e0d764e7e6ac637cfc8c053580c43f7246318dafad2974de3c -R fa3de8848fde01ec07b6ff80f323523f +P 50ad60ded54aa22dfdf519ed5da6451de790e22a972ff299f7976fbdce7a0579 +R 70185df2307fdc4359181caa65daa887 U drh -Z 8ada4e4e3a5f42b8890ba86493cb429e +Z 0303a77637cd34b7c34820a37ec20c26 diff --git a/manifest.uuid b/manifest.uuid index bf1abc06e9..7429bc11a2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -50ad60ded54aa22dfdf519ed5da6451de790e22a972ff299f7976fbdce7a0579 \ No newline at end of file +3dd6fe53c7ae6ebe2393e956d040e00b8cd0589674d20aafe1585aaa61325bbe \ No newline at end of file diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh index 4864ee85c3..4a1730b626 100644 --- a/tool/mkautoconfamal.sh +++ b/tool/mkautoconfamal.sh @@ -51,6 +51,7 @@ cp sqlite3.h $TMPSPACE cp sqlite3ext.h $TMPSPACE cp $TOP/sqlite3.1 $TMPSPACE cp $TOP/sqlite3.pc.in $TMPSPACE +cp $TOP/src/msvc.h $TMPSPACE cp $TOP/src/shell.c $TMPSPACE cp $TOP/src/sqlite3.rc $TMPSPACE cp $TOP/tool/Replace.cs $TMPSPACE From 2435fa69161be6b253cb08541cb6452b232ba9dd Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 22 May 2017 13:58:13 +0000 Subject: [PATCH 6/6] Version 3.19.0 FossilOrigin-Name: 28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40 --- manifest | 11 +++++++---- manifest.uuid | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/manifest b/manifest index c8d1cd13f7..6b3f641961 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Include\sthe\s"msvc.h"\sheader\sfile\sin\sthe\samalgamation\starball. -D 2017-05-22T13:06:45.288 +C Version\s3.19.0 +D 2017-05-22T13:58:13.592 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 8eeb80162074004e906b53d7340a12a14c471a83743aab975947e95ce061efcc @@ -1580,7 +1580,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 50ad60ded54aa22dfdf519ed5da6451de790e22a972ff299f7976fbdce7a0579 +P 3dd6fe53c7ae6ebe2393e956d040e00b8cd0589674d20aafe1585aaa61325bbe R 70185df2307fdc4359181caa65daa887 +T +bgcolor * #d0c0ff +T +sym-release * +T +sym-version-3.19.0 * U drh -Z 0303a77637cd34b7c34820a37ec20c26 +Z b6ab1af5186519250316abf46ab3c207 diff --git a/manifest.uuid b/manifest.uuid index 7429bc11a2..a38c601c9b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3dd6fe53c7ae6ebe2393e956d040e00b8cd0589674d20aafe1585aaa61325bbe \ No newline at end of file +28a94eb282822cad1d1420f2dad6bf65e4b8b9062eda4a0b9ee8270b2c608e40 \ No newline at end of file