Re: Interesting message about printf()'s in PostgreSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interesting message about printf()'s in PostgreSQL
Дата
Msg-id 28308.1029134117@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Interesting message about printf()'s in PostgreSQL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
>> src/backend/port/dynloader/freebsd.c
> This one is perhaps dodgy.  You ahve this:
> static char error_message[BUFSIZ];
> Then you have this:
>         sprintf(error_message, "dlopen (%s) not supported", file);
> Where file isn't restricted in length I think...

Yeah.  In practice I'm not sure there's a problem --- the callers may
all limit the filename string to MAXPGPATH, which is well below BUFSIZ.
But changing the sprintf to snprintf is a cheap, localized way to be
sure.
        regards, tom lane


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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Interesting message about printf()'s in PostgreSQL
Следующее
От: Mario Weilguni
Дата:
Сообщение: Re: OOP real life example (was Re: Why is MySQL more chosen