summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-20 02:37:51 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-20 02:37:51 -0400
commit1427f5ecf917d5be28243c445edbbab8945ebc65 (patch)
tree7fa0390d11bfd27ad9b4e52a28ee5bfd4b1554a1 /cryptlib.cpp
parent1abb5c36bd0055c203f3f283924ebdcfc029c073 (diff)
downloadcryptopp-git-1427f5ecf917d5be28243c445edbbab8945ebc65.tar.gz
Clear coverity finding FORWARD_NULL (CID 147865)
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 24eb0209..3cac112f 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -171,18 +171,19 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
outIncrement = 0-outIncrement;
}
+ // Coverity finding.
+ bool xorFlag = xorBlocks && (flags & BT_XorInput);
while (length >= blockSize)
{
- if (flags & BT_XorInput)
+ if (xorFlag)
{
- // Coverity finding. However, xorBlocks is never NULL if BT_XorInput.
- CRYPTOPP_ASSERT(xorBlocks);
+ // xorBlocks non-NULL and with BT_XorInput.
xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
ProcessBlock(outBlocks);
}
else
{
- // xorBlocks can be NULL. See, for example, ECB_OneWay::ProcessData.
+ // xorBlocks may be non-NULL and without BT_XorInput.
ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
}