From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Naoya Anzai <nao-anzai@xc.jp.nec.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Cc: Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Subject: Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
Date: Tue, 22 Sep 2015 10:55:02 +0300
Message-ID: <56010956.1060108@iki.fi> (raw)
In-Reply-To: <116262CF971C844FB6E793F8809B51C6EF245E@BPXM02GP.gisp.nec.co.jp>
References: <116262CF971C844FB6E793F8809B51C6EF245E@BPXM02GP.gisp.nec.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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 an original 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
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: hlinnaka@iki.fi, nao-anzai@xc.jp.nec.com, aki-iwaasa@vt.jp.nec.com
Subject: Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
In-Reply-To: <56010956.1060108@iki.fi>
References: <116262CF971C844FB6E793F8809B51C6EF245E@BPXM02GP.gisp.nec.co.jp> <56010956.1060108@iki.fi>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox