Обсуждение: BUG #19065: postgresql-18.0/src/bin/pg_combinebackup/reconstruct.c:230: Array sanity check in wrong place ?

Поиск
Список
Период
Сортировка
The following bug has been logged on the website:

Bug reference:      19065
Logged by:          David Binderman
Email address:      dcb314@hotmail.com
PostgreSQL version: 18.0
Operating system:   fedora 42
Description:

Static analyser cppcheck said:

postgresql-18.0/src/bin/pg_combinebackup/reconstruct.c:230:18: style: Array
index 'b' is used before limits check. [arrayIndexThenCheck]

Source code is

        if (sourcemap[b] == NULL && b < blocklength)

Suggest new code

        if (b < blocklength && sourcemap[b] == NULL)