[PATCH] Fix incorrect fprintf usage in log_error FRONTEND path

Поиск
Список
Период
Сортировка
От Bryan Green
Тема [PATCH] Fix incorrect fprintf usage in log_error FRONTEND path
Дата
Msg-id CAF+pBj8goe4fRmZ0V3Cs6eyWzYLvK+HvFLYEYWG=TzaM+tWPnw@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Fix incorrect fprintf usage in log_error FRONTEND path
Список pgsql-hackers
Hi,
I noticed that the log_error() utility function has a bug in its FRONTEND code path. The function uses fprintf() with a va_list argument, but fprintf() expects individual arguments. This should
be vfprintf() instead.

The relevant code:

#else
    fprintf(stderr, fmt, ap);
#endif

Should be:

#else
    vfprintf(stderr, fmt, ap);
#endif

While this code path may not currently be compiled in practice, it would cause compilation warnings or runtime crashes if the FRONTEND macro is ever defined for files containing this function.

I've attached a patch that fixes this issue.

Bryan Green
Вложения

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