Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZeMx3-0001RQ-JP for pgsql-odbc@arkaria.postgresql.org; Tue, 22 Sep 2015 12:45:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZeMx3-0003FM-5M for pgsql-odbc@arkaria.postgresql.org; Tue, 22 Sep 2015 12:45:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZeMwg-0002px-Ay for pgsql-odbc@postgresql.org; Tue, 22 Sep 2015 12:45:18 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZeMwY-0005HK-UI for pgsql-odbc@postgresql.org; Tue, 22 Sep 2015 12:45:17 +0000 Received: by wicfx3 with SMTP id fx3so21913740wic.0 for ; Tue, 22 Sep 2015 05:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=umzNSY/CtOeeUASCyAOXZU/lDhpeF9YF1i6L4Gao9C0=; b=EzWl6L4YBCz/dnoJ9HYAvo0Puz2mV44Wl6dPfbg/E1Ev3j07utS5PpQUdDi4u+YmNf ZV4jzMe03Lmy+4XN2VEqTH77/OHv6sLkKuJ87ENwAMlIbH7kz2K4r1xZo94NDJi+Cdw7 XwxspLQBsH+GEU8pBWb9lH2kpyNKhw2onhF6keSmG2xb7IV97C1Jss0T55npPod4DFey 3DUG+XJ0viGe9hPuzDqT2u+U8cVMt0kQaMasDwa8+IuvljksqK53bPIo8NhQwF1f9XWf QGjyYZv4ieKG1V7LOMULpJCj7CU5v0uPtdI3T+5+lfsNdPqBkcmCVrWxLKB8lbk948m8 otBQ== X-Received: by 10.194.77.77 with SMTP id q13mr25521904wjw.79.1442925908537; Tue, 22 Sep 2015 05:45:08 -0700 (PDT) Received: from [192.168.1.110] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by smtp.gmail.com with ESMTPSA id x7sm2983587wia.10.2015.09.22.05.45.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 05:45:07 -0700 (PDT) Message-ID: <56014D52.1040000@iki.fi> Date: Tue, 22 Sep 2015 15:45:06 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Andrus , pgsql-odbc@postgresql.org Subject: Re: How to fix buffer overrun in Windows x32 References: <1B88854920C942948F943E26B452E3A4@dell2> <560103D8.2090603@iki.fi> In-Reply-To: Content-Type: text/plain; charset=windows-1257; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org 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 -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc