Re: How to fix buffer overrun in Windows x32 - Mailing list pgsql-odbc

From Heikki Linnakangas
Subject Re: How to fix buffer overrun in Windows x32
Date
Msg-id 56014D52.1040000@iki.fi
Whole thread Raw
In response to Re: How to fix buffer overrun in Windows x32  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-odbc
On 09/22/2015 11:03 AM, Andrus wrote:
> Hi!
>
>> Can you create a little test program to reproduce that? That would be best.
>> If that's not possible, please enable the Debug option for the datasource,
>> and send over the log.
>
> Testcase is
>
> http://stackoverflow.com/questions/32650613/how-to-fix-buffer-overrun-in-psqlodbc-driver
>
> If you dont have VFP you can copy postgresql code from it and pass to odbc
> execdirect in C or other language.
> I uploaded logs week ago to odbc issue tracker into one old closed issue.

Ah, found it finally! There was a buffer overflow of two bytes, in
SC_create_errorinfo() function. Apparently that didn't cause a crash on
other platforms, but that was just luck. The overflow happened if the
error message was longer than 4096 bytes.

Fixed, thanks for the report! I also added a test case for that to the
regression suite.

- Heikki



pgsql-odbc by date:

Previous
From: "Andrus"
Date:
Subject: Re: How to fix buffer overrun in Windows x32
Next
From: Naoya Anzai
Date:
Subject: Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.