Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B25D4B5DC09 for ; Fri, 27 May 2011 23:04:23 -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 24485-06 for ; Sat, 28 May 2011 02:04:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 780A1B5DBF9 for ; Fri, 27 May 2011 23:04:16 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4S24FMd009898; Fri, 27 May 2011 22:04:16 -0400 (EDT) To: "Christopher Dillard" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6044: Access violation on XML decl with standalone In-reply-to: <201105272002.p4RK24nG040936@wwwmaster.postgresql.org> References: <201105272002.p4RK24nG040936@wwwmaster.postgresql.org> Comments: In-reply-to "Christopher Dillard" message dated "Fri, 27 May 2011 20:02:04 +0000" Date: Fri, 27 May 2011 22:04:15 -0400 Message-ID: <9897.1306548255@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/205 X-Sequence-Number: 30344 "Christopher Dillard" writes: > In PostgreSQL 8.4.8, the function "xml_recv" (in > src/backend/utils/adt/xml.c) calls the function "parse_xml_decl", passing > NULL for the final "standalone" parameter. However, "parse_xml_decl" does > not check for standalone==NULL, and blindly sets "*standalone = 0". This > causes a crash if the xml declaration actually has a standalone parmeter, > e.g. ''. Ugh, you're right. > I wish I could provide a SQL test case, but I only found this by setting a > breakpoint on the 0xC0000005 exception in Visual Studio. AFAIK there isn't any way to exercise the receive functions via psql. You need a client that will send data as binary parameters. But it's obvious by inspection of the code that it's broken. Will fix, thanks for the report! regards, tom lane