From: Peter Eisentraut <peter_e@gmx.net>
To: Martin Pitt <mpitt@debian.org>
To: pgsql-bugs@postgresql.org
To: pgsql-odbc@postgresql.org
Cc: 247306@bugs.debian.org
Subject: Re: Fix for buffer overflow ready [was: Fwd: Bug#247306: odbc-postgresql: SIGSEGV with long inputs (> 10000 bytes)]
Date: Thu, 13 May 2004 19:43:09 +0200
Message-ID: <200405131943.09803.peter_e@gmx.net> (raw)
In-Reply-To: <20040513094155.GA28717@ifsr.de>
References: <20040511100357.GA23102@ifsr.de>
<20040513094155.GA28717@ifsr.de>
Martin Pitt wrote:
> The problem is that make_string() in misc.c does not check whether
> the target buffer is big enough to hold the copied string.
>
> I added a bufsize parameter to make_string() and used it in all calls
> to it. I tried it with my php4 crash test script and now it works
> properly.
Silently truncating various pieces of information is probably not the
right thing. What are you truncating? If it's a query string you
might open yourself up to SQL-injection type problems.
Plus, the ODBC driver appears to have buffer overruns all over the
place. We need to replace every instance of strcpy, strcat, sprintf,
make_string, and the various other feeble attempts with pqexpbuffer
from libpq. That's the only way to solve this problem once and for
all.
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: peter_e@gmx.net, mpitt@debian.org, pgsql-bugs@postgresql.org, 247306@bugs.debian.org
Subject: Re: Fix for buffer overflow ready [was: Fwd: Bug#247306: odbc-postgresql: SIGSEGV with long inputs (> 10000 bytes)]
In-Reply-To: <200405131943.09803.peter_e@gmx.net>
References: <20040511100357.GA23102@ifsr.de> <20040513094155.GA28717@ifsr.de> <200405131943.09803.peter_e@gmx.net>
* 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