Clear coverity finding FORWARD_NULL (CID 147865)

pull/242/merge
Jeffrey Walton 2017-05-20 02:37:51 -04:00
parent 1abb5c36bd
commit 1427f5ecf9
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 5 additions and 4 deletions

View File

@ -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);
}