Clear coverity finding FORWARD_NULL (CID 147865)
parent
25fcb7bef8
commit
0bdbde2c21
|
|
@ -171,18 +171,18 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
|
||||||
outIncrement = 0-outIncrement;
|
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)
|
while (length >= blockSize)
|
||||||
{
|
{
|
||||||
if (flags & BT_XorInput)
|
if (xorFlag)
|
||||||
{
|
{
|
||||||
// Coverity finding. However, xorBlocks is never NULL if BT_XorInput.
|
|
||||||
CRYPTOPP_ASSERT(xorBlocks);
|
|
||||||
xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
|
xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
|
||||||
|
xorBlocks += xorIncrement;
|
||||||
ProcessBlock(outBlocks);
|
ProcessBlock(outBlocks);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// xorBlocks can be NULL. See, for example, ECB_OneWay::ProcessData.
|
|
||||||
ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
|
ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +190,6 @@ size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const by
|
||||||
const_cast<byte *>(inBlocks)[blockSize-1]++;
|
const_cast<byte *>(inBlocks)[blockSize-1]++;
|
||||||
inBlocks += inIncrement;
|
inBlocks += inIncrement;
|
||||||
outBlocks += outIncrement;
|
outBlocks += outIncrement;
|
||||||
xorBlocks += xorIncrement;
|
|
||||||
length -= blockSize;
|
length -= blockSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue