pgsql: Ensure _dosmaperr() actually sets errno correctly.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Ensure _dosmaperr() actually sets errno correctly.
Дата
Msg-id E1VkMa0-00009M-PA@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Ensure _dosmaperr() actually sets errno correctly.

If logging is enabled, either ereport() or fprintf() might stomp on errno
internally, causing this function to return the wrong result.  That might
only end in a misleading error report, but in any code that's examining
errno to decide what to do next, the consequences could be far graver.

This has been broken since the very first version of this file in 2006
... it's a bit astonishing that we didn't identify this long ago.

Reported by Amit Kapila, though this isn't his proposed fix.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ec6a6a268a634a3eae3add9088392c77627dfb26

Modified Files
--------------
src/port/win32error.c |    8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Avoid potential buffer overflow crash
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Ensure _dosmaperr() actually sets errno correctly.