You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-06 08:49:29 +02:00
Adjust range check per Coverity complaint.
Coverity complained that: Overrunning array "optionGroupIndexKeep[optionGroupIdx]" of 512 bytes at byte offset 4294967550 using index "keyIdx" (which evaluates to 4294967294). This does not seem possible but adjust the code to make Coverity happy, as usual.
This commit is contained in:
@@ -2577,7 +2577,7 @@ cfgParse(const Storage *const storage, const unsigned int argListSize, const cha
|
||||
ConfigOptionGroupData *const optionGroup = &config->optionGroup[optionGroupIdx];
|
||||
|
||||
// Iterate group indexes
|
||||
for (unsigned int keyIdx = optionGroup->indexTotal - 1; keyIdx < UINT_MAX; keyIdx--)
|
||||
for (unsigned int keyIdx = optionGroup->indexTotal - 1; keyIdx + 1 > 0; keyIdx--)
|
||||
{
|
||||
// Break if there is only one index since each group must have at least one
|
||||
if (optionGroup->indexTotal == 1)
|
||||
|
||||
Reference in New Issue
Block a user