diff options
author | drh <> | 2021-10-04 18:21:14 +0000 |
---|---|---|
committer | drh <> | 2021-10-04 18:21:14 +0000 |
commit | 11a9ad566929d7c8112be6d14c6c25f346f4dc5a (patch) | |
tree | 43a6d28aa1cf496abe02d5013fa6d095734cbca3 /ext/session/sqlite3session.c | |
parent | 1076130a5d844978948247fb89374a91e9edab13 (diff) | |
download | sqlite-11a9ad566929d7c8112be6d14c6c25f346f4dc5a.tar.gz sqlite-11a9ad566929d7c8112be6d14c6c25f346f4dc5a.zip |
Fix harmless static analyzer warnings in sessions, rtree, fts3 and fts5.
Add the -DSQLITE_OMIT_AUXILIARY_SAFETY_CHECKS compile-time option to cause
ALWAYS() and NEVER() macros to be omitted from the build.
FossilOrigin-Name: 1c67f957fc77e37ce8f0d447c41ca975e8e79a35d332739c24a633649b5b0387
Diffstat (limited to 'ext/session/sqlite3session.c')
-rw-r--r-- | ext/session/sqlite3session.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c index c96363b60..b404e5b26 100644 --- a/ext/session/sqlite3session.c +++ b/ext/session/sqlite3session.c @@ -420,7 +420,7 @@ static int sessionSerializeValue( if( aBuf ){ sessionVarintPut(&aBuf[1], n); - if( n ) memcpy(&aBuf[nVarint + 1], z, n); + if( n>0 ) memcpy(&aBuf[nVarint + 1], z, n); } nByte = 1 + nVarint + n; @@ -3651,11 +3651,11 @@ static int sessionChangesetInvert( } assert( rc==SQLITE_OK ); - if( pnInverted ){ + if( pnInverted && ALWAYS(ppInverted) ){ *pnInverted = sOut.nBuf; *ppInverted = sOut.aBuf; sOut.aBuf = 0; - }else if( sOut.nBuf>0 ){ + }else if( sOut.nBuf>0 && ALWAYS(xOutput!=0) ){ rc = xOutput(pOut, sOut.aBuf, sOut.nBuf); } @@ -4111,7 +4111,7 @@ static int sessionBindRow( for(i=0; rc==SQLITE_OK && i<nCol; i++){ if( !abPK || abPK[i] ){ - sqlite3_value *pVal; + sqlite3_value *pVal = 0; (void)xValue(pIter, i, &pVal); if( pVal==0 ){ /* The value in the changeset was "undefined". This indicates a |