pgsql: Fix null-dereference crash in parse_xml_decl().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix null-dereference crash in parse_xml_decl().
Date: 2011-05-28 16:38:29
Message-ID: E1QQMWy-0000ac-WC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix null-dereference crash in parse_xml_decl().

parse_xml_decl's header comment says you can pass NULL for any unwanted
output parameter, but it failed to honor this contract for the "standalone"
flag. The only currently-affected caller is xml_recv, so the net effect is
that sending a binary XML value containing a standalone parameter in its
xml declaration would crash the backend. Per bug #6044 from Christopher
Dillard.

In passing, remove useless initializations of parse_xml_decl's output
parameters in xml_parse.

Back-patch to 8.3, where this code was introduced.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ab7c5a90828472c2261048a7195ab9218b55e296

Modified Files
--------------
src/backend/utils/adt/xml.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2011-05-28 22:25:27 pgsql: Allow pg_basebackup compressed tar output to stdout
Previous Message Tom Lane 2011-05-28 16:38:28 pgsql: Fix null-dereference crash in parse_xml_decl().