diff options
-rw-r--r-- | manifest | 14 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/btree.c | 3 | ||||
-rw-r--r-- | src/util.c | 12 |
4 files changed, 20 insertions, 11 deletions
@@ -1,5 +1,5 @@ -C Omit\sthe\suse\sof\smemmove()\sin\ssqlite3FpDecode()\sin\san\sattempt\sto\savoid\nspurious\swarnings\sfrom\svalgrind.\s\sAlso\smakes\sthe\scode\sslightly\ssmaller\sand\nfaster. -D 2023-07-07T18:49:08.930 +C Fix\sharmless\sscan-build\swarnings. +D 2023-07-08T14:27:55.386 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -576,7 +576,7 @@ F src/auth.c 19b7ccacae3dfba23fc6f1d0af68134fa216e9040e53b0681b4715445ea030b4 F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523 F src/bitvec.c 9eac5f42c11914d5ef00a75605bb205e934f435c579687f985f1f8b0995c8645 F src/btmutex.c 79a43670447eacc651519a429f6ece9fd638563cf95b469d6891185ddae2b522 -F src/btree.c c0c93b6cb4dc133b528c1290bb4ad0f2414452f9a5758ff2b106af718874f39e +F src/btree.c c9400cc1509116a29120dc06feb00ca7e26b5a4a6dba80758b1ba109d8fce5a4 F src/btree.h aa354b9bad4120af71e214666b35132712b8f2ec11869cb2315c52c81fad45cc F src/btreeInt.h 3b4eff7155c0cea6971dc51f62e3529934a15a6640ec607dd42a767e379cb3a9 F src/build.c a8ae3b32d9aa9bbd2c0e97d7c0dd80def9fbca408425de1608f57ee6f47f45f4 @@ -705,7 +705,7 @@ F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 0aa36561167a7c40d01163238c297297962f31a15a8d742216b3c37cdf25f731 F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 -F src/util.c 672c28c8897a5901e1899b0905edc357addac0af4e7a0c498ab7793bdc9436b9 +F src/util.c c2c4c0d78060bae452b1f332e493868476a1d74a10053dd0a3235ab6f5bbe19d F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c 74282a947234513872a83b0bab1b8c644ece64b3e27b053ef17677c8ff9c81e0 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 @@ -2043,8 +2043,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 d3532eaed1cc671d8149b1bd34ead2a88fb83502a2898a5f60aea0a7daf18958 -R 4a4400c3c49ba8b871f445cac215bb74 +P b409943af00e35ad05906d0a80ffa1225a66f3d807c131e00cfbf6671a03a981 +R f6d7895f9e1a4f2f157e2c00c74052a3 U drh -Z 95723430906d3a88b97575fa5de4826b +Z 31aaf2b4d0a16e9a02d6a166e7eb62cb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3ed4fb5f6..e1e9c3ddf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b409943af00e35ad05906d0a80ffa1225a66f3d807c131e00cfbf6671a03a981
\ No newline at end of file +beab3c98639be531744e60440223bb9ee76bc15234aff05e5efb273c8241dfd8
\ No newline at end of file diff --git a/src/btree.c b/src/btree.c index aa4e28601..643d1c42d 100644 --- a/src/btree.c +++ b/src/btree.c @@ -5341,6 +5341,7 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){ pCur->ix = 0; pCur->iPage++; rc = getAndInitPage(pCur->pBt, newPgno, &pCur->pPage, pCur->curPagerFlags); + assert( pCur->pPage!=0 || rc!=SQLITE_OK ); if( rc==SQLITE_OK && (pCur->pPage->nCell<1 || pCur->pPage->intKey!=pCur->curIntKey) ){ @@ -5569,7 +5570,7 @@ int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){ *pRes = 0; rc = moveToLeftmost(pCur); }else if( rc==SQLITE_EMPTY ){ - assert( pCur->pgnoRoot==0 || pCur->pPage->nCell==0 ); + assert( pCur->pgnoRoot==0 || (pCur->pPage!=0 && pCur->pPage->nCell==0) ); *pRes = 1; rc = SQLITE_OK; } diff --git a/src/util.c b/src/util.c index 2b5c193e3..ce0299706 100644 --- a/src/util.c +++ b/src/util.c @@ -933,6 +933,11 @@ int sqlite3Atoi(const char *z){ ** n is positive. Or round to -n signficant digits after the ** decimal point if n is negative. No rounding is performed if ** n is zero. +** +** The significant digits of the decimal representation are +** stored in p->z[] which is a often (but not always) a pointer +** into the middle of p->zBuf[]. There are p->n significant digits. +** The p->z[] array is *not* zero-terminated. */ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ int i; @@ -1025,14 +1030,16 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ /* Extract significant digits. */ i = sizeof(p->zBuf)-1; + assert( v>0 ); while( v ){ p->zBuf[i--] = (v%10) + '0'; v /= 10; } - assert( i>=0 ); + assert( i>=0 && i<sizeof(p->zBuf)-1 ); p->n = sizeof(p->zBuf) - 1 - i; + assert( p->n>0 ); assert( p->n<sizeof(p->zBuf) ); p->iDP = p->n + exp; if( iRound<0 ){ iRound = p->iDP - iRound; - if( iRound==0 && p->z[i+1]>='5' ){ + if( iRound==0 && p->zBuf[i+1]>='5' ){ iRound = 1; p->zBuf[i--] = '0'; p->n++; @@ -1061,6 +1068,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ } } p->z = &p->zBuf[i+1]; + assert( i+p->n < sizeof(p->zBuf) ); while( ALWAYS(p->n>0) && p->z[p->n-1]=='0' ){ p->n--; } } |