X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F17B1DB3DD for ; Sun, 30 Oct 2005 14:28:56 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94065-02 for ; Sun, 30 Oct 2005 18:28:54 +0000 (GMT) Received: from Mail2.KONTENT.De (mail2.kontent.de [81.88.34.59]) by svr1.postgresql.org (Postfix) with ESMTP id 5C714DB231 for ; Sun, 30 Oct 2005 14:28:53 -0400 (AST) Received: from jedi.behrens.de (p5085C166.dip0.t-ipconnect.de [80.133.193.102]) by Mail2.KONTENT.De (Postfix) with ESMTP id 1B075388089 for ; Sun, 30 Oct 2005 19:28:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by jedi.behrens.de (Postfix) with ESMTP id 6DB151A5B0 for ; Sun, 30 Oct 2005 19:28:40 +0100 (CET) Received: from jedi.behrens.de ([127.0.0.1]) by localhost (jedi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11289-08 for ; Sun, 30 Oct 2005 19:28:40 +0100 (CET) Received: from anakin (anakin.behrens.de [192.168.150.240]) by jedi.behrens.de (Postfix) with ESMTP id 4A38B1A559 for ; Sun, 30 Oct 2005 19:28:40 +0100 (CET) From: lothar.behrens@lollisoft.de To: pgsql-odbc@postgresql.org Date: Sun, 30 Oct 2005 19:28:38 +0100 MIME-Version: 1.0 Subject: Buffer overrun in copy_statement_with_parameters ? Message-ID: <43651EE6.27992.253829E@localhost> X-mailer: Pegasus Mail for Windows (4.21c, DE v4.21c R1a) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: Quoted-printable Content-description: Mail message body X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.368 required=5 tests=[AWL=-0.182, NO_REAL_NAME=0.55] X-Spam-Score: 0.368 X-Spam-Level: X-Archive-Number: 200510/126 X-Sequence-Number: 6228 Hi, currently I try to find malloc bugs in my code and it may be that some of = the mpatrol log entries are related to the following function in convert.c: copy_statement_with_parameters(...) Mpatrol reports ERROR: [RNGOVF]: memcpy: range [0x08070370,0x0807038A] overflows [0x08070350,0x0 807037E] 0x08070350 (47 bytes) {malloc:5667:0} [-|-|-] 0x4058DC9E ??? <------- Used as b= reakpoint 0x4058BFD2 ??? 0x405A168C ??? 0x4051B60B ??? 0x4048B3FC ??? 0x08049578 main+1452 0x401D1500 __libc_start_main+224 0x08048F31 _start+33 But if I print out some debug messages, it seems ok. The buffer is about 4= 096 bytes. Any ideas ? I have SuSE 9.1/mpatrol 1.4.8/psqlODBC 07.03.0200 Thanks, Lothar // ... if (0 !=3D (qb->flags & FLGB_KEYSET_DRIVEN)) { qb->npos =3D npos; /* ---------- * 1st query is for field information * 2nd query is keyset gathering */ CVT_APPEND_STR(qb, " where ctid =3D '(0,0)';select ctid, oid from "); //- Problematic code ----------------------- CVT_APPEND_DATA(qb, qp->statement + qp- >from_pos + 5, npos - qp->from_pos - 5); //------------------------------------------------- } } stmt->load_statement =3D malloc(npos + 1); memcpy(stmt->load_statement, qb->query_statement, npos); stmt->load_statement[npos] =3D '\0'; } #endif /* DRIVER_CURSOR_IMPLEMENT */ -- Lothar Behrens | Rapid Prototyping ... Rosmarinstr 3 | 40235 D=FCsseldorf | www.lollisoft.de