Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4F7199FBE0E for ; Tue, 17 Jul 2007 18:35:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 51968-04 for ; Tue, 17 Jul 2007 18:34:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 9C2649FBE08 for ; Tue, 17 Jul 2007 18:34:59 -0300 (ADT) Received: (qmail 26595 invoked from network); 18 Jul 2007 06:34:56 +0900 X-Authentication: inoue was authenticated by smtp.tpf.co.jp at 18 Jul 2007 06:34:56 +0900 Received: from unknown (HELO ?192.168.11.3?) (219.61.40.6) by smtp.tpf.co.jp with SMTP; 18 Jul 2007 06:34:56 +0900 Message-ID: <469D35F7.6060305@tpf.co.jp> Date: Wed, 18 Jul 2007 06:34:47 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Rainer Bauer CC: pgsql-odbc@postgresql.org Subject: Re: Bug in ResolveOneParam() References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/33 X-Sequence-Number: 9088 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 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; > }