pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Rainer Bauer <usenet@munnin.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Bug in ResolveOneParam()
Date: Wed, 18 Jul 2007 06:34:47 +0900
Message-ID: <469D35F7.6060305@tpf.co.jp> (raw)
In-Reply-To: <j7fm935tfveflo3ubh8n02qk7ao172kd7j@4ax.com>
References: <j7fm935tfveflo3ubh8n02qk7ao172kd7j@4ax.com>

Rainer Bauer wrote:
> Hello,
> 
> I finally was able to track down the bug that occasionally happened when
> UseServerSidePrepare was enabled: the driver is writing past allocated memory.

> The bug is in ResolveOneParam(). At one point this function writes directly
> into the allocated buffer <qb->query_statement> _without_ checking the
> allocated size by calling enlarge_query_statement().
> 
> I have added the ENLARGE_NEWSTATEMENT() call which should take care of this
> bug (see attached patch).


Sorry for the delay.
I would take care of it.

Thanks.

Hiroshi Inoue

> Rainer
> 
> Index: convert.c
> ===================================================================
> RCS file: /cvsroot/psqlodbc/psqlodbc/convert.c,v
> retrieving revision 1.161
> diff -u -r1.161 convert.c
> --- convert.c	4 Jun 2007 10:24:49 -0000	1.161
> +++ convert.c	16 Jul 2007 09:52:51 -0000
> @@ -3459,6 +3472,7 @@
>  	} */
>  	if (req_bind)
>  	{
> +		ENLARGE_NEWSTATEMENT( qb, (qb->npos+4) );
>  		npos = qb->npos;
>  		qb->npos += 4;
>  	}




view thread (2+ messages)

Message-ID: <469D35F7.6060305@tpf.co.jp>
Permalink:  ../469D35F7.6060305@tpf.co.jp/
Also on:    postgresql.org/message-id/469D35F7.6060305@tpf.co.jp

 · 

reply

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: inoue@tpf.co.jp, usenet@munnin.com
  Subject: Re: Bug in ResolveOneParam()
  In-Reply-To: <469D35F7.6060305@tpf.co.jp>
  References: <j7fm935tfveflo3ubh8n02qk7ao172kd7j@4ax.com> <469D35F7.6060305@tpf.co.jp>

* 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