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

From: "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-odbc(at)lists(dot)postgresql(dot)org, Werewolf <werewolfff(at)yandex(dot)ru>
Subject: Re: Fwd: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
Date: 2019-06-27 03:44:16
Message-ID: a13aebaf-3147-b1ee-57d2-240a51f1c0b0@dream.email.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

On 2019/06/27 1:35, Tom Lane wrote:
> Forwarding to correct list ...
>
> ------- Forwarded Message
>
> Date: Wed, 26 Jun 2019 19:00:58 +0300
> From: Werewolf <werewolfff(at)yandex(dot)ru>
> To: pgsql-bugs(at)lists(dot)postgresql(dot)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=ba0dd6d731bbccd81392def43ae9b10e9c013aef;hb=HEAD#l1240
>
> Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype = SQL_IS_SMALLINT;'.

Oops, my mistake.
I would commit the fix.

thanks.
Hiroshi Inoue
>
> ------- End of Forwarded Message
>
>
>
> ---

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Ashutosh Sharma 2019-06-27 08:48:59 Re: psqlODBC - PostgreSQL ODBC driver error
Previous Message Inoue, Hiroshi 2019-06-26 20:18:34 Re: psqlodbc: No memory available to store statement