Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 54B14B5DBDB for ; Mon, 23 May 2011 16:30:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 43768-02 for ; Mon, 23 May 2011 19:30:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by mail.postgresql.org (Postfix) with ESMTP id 9B78DB5D8BD for ; Mon, 23 May 2011 16:30:44 -0300 (ADT) Received: from mail-ey0-f171.google.com ([209.85.215.171]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKTdq14/pPp4RIX7Lp8oWxWzOjnUHEQ0+2@postini.com; Mon, 23 May 2011 12:30:45 PDT Received: by eydd26 with SMTP id d26so3108796eyd.30 for ; Mon, 23 May 2011 12:30:42 -0700 (PDT) Received: by 10.213.1.144 with SMTP id 16mr923977ebf.113.1306179041312; Mon, 23 May 2011 12:30:41 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id y2sm4844517eeh.25.2011.05.23.12.30.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 12:30:40 -0700 (PDT) Message-ID: <4DDAB5DE.5000801@enterprisedb.com> Date: Mon, 23 May 2011 22:30:38 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.16) Gecko/20110505 Icedove/3.0.11 MIME-Version: 1.0 To: Tom Lane CC: Dean Rasheed , pgsql-bugs@postgresql.org Subject: Re: Seg-fault in format(text) References: <12736.1306161191@sss.pgh.pa.us> <4DDA78FB.2020103@enterprisedb.com> <13683.1306164998@sss.pgh.pa.us> In-Reply-To: <13683.1306164998@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/167 X-Sequence-Number: 30306 On 23.05.2011 18:36, Tom Lane wrote: > Heikki Linnakangas writes: >> It's a stretch that we'd ever support two billion arguments in any form, >> but an explicit check for "arg< 0" would make me feel better. > > No objection here, especially since I've just determined that bug #6035 > is also some kind of unhandled-overflow problem... Committed, using your suggested fix. I realized that switching to strtoul() wouldn't work without some further changes, because the format string is not null-terminated. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com