Re: BUG #16191: Errors of division by zero occur in several files.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #16191: Errors of division by zero occur in several files.
Дата
Msg-id 20200106052636.GN3598@paquier.xyz
обсуждение исходный текст
Ответ на BUG #16191: Errors of division by zero occur in several files.  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Mon, Jan 06, 2020 at 04:00:17AM +0000, PG Bug reporting form wrote:
> We checked the codes in files “xlogreader.c”, “xlog.c”, “xlogutils.c”,
> “xlogarchive.c”, “walsender.c”, “parsexlog.c”, “pg_rewind.c”,
> “pg_resetwal.c”, “pg_waldump.c” and  “receivelog.c”, and found 20 errors
> caused by the zero value used in division. There are five errors in file
> “xlogreader.c” occurring in lines 755, 769, 819, 839 and 864 and the codes
> of these five lines are the same: “XLogFileName(fname,
> state->readPageTLI, segno, state->wal_segment_size);”.
> The program should check the effectiveness (not zero) of the return value of
> function “XLogSegmentsPerXLogId” in file “xlog_internal.h” to avoid this
> type of errors.

Reading the code is one thing.  Understanding it is another.  Have you
actually read the code and did you notice the assumptions behind the
ranges allowed by wal_segment_size (as known as WalSegMinSize and
WalSegMaxSize defined in xlog_internal.h)?
--
Michael

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #16190: The usage of NULL pointer in refint.c
Следующее
От: Fahar Abbas
Дата:
Сообщение: Re: postgresql mac operation issue 10.11