pgsql: Correct off-by-one when reading from pipe

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Correct off-by-one when reading from pipe
Дата
Msg-id E1Uyk5V-0007j7-JV@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Correct off-by-one when reading from pipe

In pg_basebackup.c:reached_end_position(), we're reading from an
internal pipe with our own background process but we're possibly
reading more bytes than will actually fit into our buffer due to
an off-by-one error.  As we're reading from an internal pipe
there's no real risk here, but it's good form to not depend on
such convenient arrangements.

Bug spotted by the Coverity scanner.

Back-patch to 9.2 where this showed up.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/22b7f5c5aa1dc2909e110b171b03d6e0c85dcd43

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: pgsql: Correct off-by-one when reading from pipe
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Correct off-by-one when reading from pipe