Re: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Werewolf <werewolfff(at)yandex(dot)ru>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
Date: 2019-07-06 20:31:14
Message-ID: 20190706203114.t74rdgzh3y3x26vt@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jun 18, 2019 at 10:31:17PM +0300, Werewolf wrote:
> 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=
> ba0dd6d731bbccd81392def43ae9b10e9c013aef;hb=HEAD#l1240
>
> Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype = SQL_IS_SMALLINT;'.

I suggest you report this to the ODB project at
pgsql-odbc(at)postgresql(dot)org(dot) See:

https://odbc.postgresql.org/faq.html#1.6

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Manuel Rigger 2019-07-07 16:30:58 VACUUM FULL results in ERROR: integer out of range
Previous Message Christoph Berg 2019-07-06 13:11:18 Re: BUG #15896: pg_upgrade from 10-or-earlier: TRAP: FailedAssertion(»!(metad->btm_version >= 3)«