pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
3+ messages / 2 participants
[nested] [flat]
* ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
@ 2019-06-18 19:31 Werewolf <werewolfff@yandex.ru>
0 siblings, 1 reply; 3+ messages in thread
From: Werewolf @ 2019-06-18 19:31 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Field SQL_DESC_COUNT
should fit into a variable of type SQLSMALLINT. But when </font><font
face="Helvetica, Arial, sans-serif"><span class="tlid-translation
translation" lang="en">retrieving this field of APD </span>SQLGetDescField
returns SQLINTEGER value. So memory corruption is possible in
application using psqlodbc driver.<br>
Also the function returns an undefined error code -8.<br>
<br>
The mistake is located here<br>
<a class="moz-txt-link-freetext" href="https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgapi30.c;h=ba0dd6d731bbccd81392def43ae9b...;
<br>
Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype =
SQL_IS_SMALLINT;'.<br>
</font>
</body>
</html>
^ permalink raw reply [nested|flat] 3+ messages in thread
* ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
@ 2019-06-26 16:00 Werewolf <werewolfff@yandex.ru>
0 siblings, 0 replies; 3+ messages in thread
From: Werewolf @ 2019-06-26 16:00 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
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;'.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
@ 2019-07-06 20:31 Bruce Momjian <bruce@momjian.us>
parent: Werewolf <werewolfff@yandex.ru>
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Momjian @ 2019-07-06 20:31 UTC (permalink / raw)
To: Werewolf <werewolfff@yandex.ru>; +Cc: pgsql-bugs@lists.postgresql.org
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@postgresql.org. See:
https://odbc.postgresql.org/faq.html#1.6
--
Bruce Momjian <bruce@momjian.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 +
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-07-06 20:31 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 19:31 ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD Werewolf <werewolfff@yandex.ru>
2019-07-06 20:31 ` Bruce Momjian <bruce@momjian.us>
2019-06-26 16:00 ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD Werewolf <werewolfff@yandex.ru>
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