Re: [PATCH] Fix off-by-one in PQprintTuples()

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [PATCH] Fix off-by-one in PQprintTuples()
Дата
Msg-id 20130120154829.GM16126@tamriel.snowman.net
обсуждение исходный текст
Ответ на [PATCH] Fix off-by-one in PQprintTuples()  (Xi Wang <xi.wang@gmail.com>)
Ответы Re: [PATCH] Fix off-by-one in PQprintTuples()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
* Xi Wang (xi.wang@gmail.com) wrote:
> Don't write past the end of tborder; the size is width + 1.

This whole block of code is woefully without any comments. :(

Strictly speaking, it's this:

tborder[i] = '\0';

Which ends up writing past the end of the buffer (which is allocated as
'width + 1').  Perhaps we should also change that to be:

tborder[width] = '\0';
Thanks,
    Stephen

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCH] Fix NULL checking in check_TSCurrentConfig()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: allowing privileges on untrusted languages