You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
Add assertions to satisfy Coverity about possible underflows.
Coverity complained about possible underflows so add assertions to demonstrate that the values in question are greater than zero.
This commit is contained in:
@@ -485,7 +485,7 @@ blockMapWrite(const BlockMap *const this, IoWrite *const output, const size_t bl
|
||||
{
|
||||
ASSERT(
|
||||
superBlock == blockMapGet(this, blockIdx) ||
|
||||
blockMapGet(this, blockIdx)->block == blockMapGet(this, blockIdx - 1)->block + 1);
|
||||
(blockIdx > 0 && (blockMapGet(this, blockIdx)->block == blockMapGet(this, blockIdx - 1)->block + 1)));
|
||||
|
||||
ioWrite(output, BUF(blockMapGet(this, blockIdx)->checksum, checksumSize));
|
||||
}
|
||||
|
||||
@@ -206,6 +206,8 @@ ioFilterGroupOpen(IoFilterGroup *const this)
|
||||
|
||||
// If this is not the last output filter then create a new output buffer for it. The output buffer for the last filter
|
||||
// will be provided to the process function.
|
||||
ASSERT(ioFilterGroupSize(this) != 0);
|
||||
|
||||
if (ioFilterOutput(filterData->filter) && filterIdx < ioFilterGroupSize(this) - 1)
|
||||
{
|
||||
filterData->output = bufNew(ioBufferSize());
|
||||
|
||||
Reference in New Issue
Block a user