summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-20 02:20:25 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-20 02:20:25 -0400
commit1abb5c36bd0055c203f3f283924ebdcfc029c073 (patch)
tree43fd9051f4bccc3df98d14bff7e2fc937849df39 /cryptlib.cpp
parent0bdbde2c21afeb858ebd6e2106c13b35b55b7ca6 (diff)
downloadcryptopp-git-1abb5c36bd0055c203f3f283924ebdcfc029c073.tar.gz
Revert "Clear coverity finding FORWARD_NULL (CID 147865)"
This broke some self tests.
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r--cryptlib.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp
index 9f1e749c..24eb0209 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -171,18 +171,18 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
outIncrement = 0-outIncrement;
}
- // Coverity finding CID 147865. In practice, if BT_XorInput, then xorBlocks is non-NULL.
- bool xorFlag = (flags & BT_XorInput) && (xorBlocks != NULLPTR);
while (length >= blockSize)
{
- if (xorFlag)
+ if (flags & BT_XorInput)
{
+ // Coverity finding. However, xorBlocks is never NULL if BT_XorInput.
+ CRYPTOPP_ASSERT(xorBlocks);
xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
- xorBlocks += xorIncrement;
ProcessBlock(outBlocks);
}
else
{
+ // xorBlocks can be NULL. See, for example, ECB_OneWay::ProcessData.
ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
}
@@ -190,6 +190,7 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
const_cast<byte *>(inBlocks)[blockSize-1]++;
inBlocks += inIncrement;
outBlocks += outIncrement;
+ xorBlocks += xorIncrement;
length -= blockSize;
}