From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-odbc@lists.postgresql.org
Cc: Werewolf <werewolfff@yandex.ru>
Subject: Fwd: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
Date: Wed, 26 Jun 2019 12:35:37 -0400
Message-ID: <9379.1561566937@sss.pgh.pa.us> (raw)
Forwarding to correct list ...
------- Forwarded Message
Date: Wed, 26 Jun 2019 19:00:58 +0300
From: Werewolf <werewolfff@yandex.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT
field of APD
Field SQL_DESC_COUNT should fit into a variable of type SQLSMALLINT. But
when retrieving this field of APD SQLGetDescField returns SQLINTEGER
value. So memory corruption is possible in application using psqlodbc
driver.
Also the function returns an undefined error code -8.
The mistake is located here
https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgapi30.c;h=ba0dd6d731bbccd81392def43ae9b...
Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype = SQL_IS_SMALLINT;'.
------- End of Forwarded Message
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: tgl@sss.pgh.pa.us, werewolfff@yandex.ru
Subject: Re: Fwd: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
In-Reply-To: <9379.1561566937@sss.pgh.pa.us>
References: <9379.1561566937@sss.pgh.pa.us>
* 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