Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
Дата
Msg-id 56010956.1060108@iki.fi
обсуждение исходный текст
Ответ на [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.  (Naoya Anzai <nao-anzai@xc.jp.nec.com>)
Ответы Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.  (Naoya Anzai <nao-anzai@xc.jp.nec.com>)
Список pgsql-odbc
On 09/16/2015 05:20 AM, Naoya Anzai wrote:
> Hi,
>
> I found a bug which psqlODBC returns a string without null-terminated when SQLFetch is executed on Windows.
> IMHO, it seems to be caused by differences of snprintf function between Windows and Linux.
> You have changed sprintf into snprintf at psqlodbc-09.03.0400 release.
> But snprintf on Windows(_snprintf) doesn't include a terminating character(\0) when a copy buffer length is less than
anoriginal buffer length; besides this returns -1. 
> Their behavior are different from that of Linux but psqlODBC does not currently make allowances for their
differences.
>
> As you can confirm this bug, I attached a program(test.cpp) which reproduces a bug.

Yep. This was already fixed in git master in January, in commit
532c0dad20087201feee3851652c114eb820311f.

We're long overdue for a release...

- Heikki


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: How to fix buffer overrun in Windows x32
Следующее
От: "Andrus"
Дата:
Сообщение: Re: How to fix buffer overrun in Windows x32