]> granicus.if.org Git - postgresql/commit
Fix null-dereference crash in parse_xml_decl().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 28 May 2011 16:36:04 +0000 (12:36 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 28 May 2011 16:36:41 +0000 (12:36 -0400)
commitf064a4f2633088ffb3269907fe58d9a410dc021f
treed592a1d10de726c25fdf6864bf9934d4ca91fc5e
parentf014211849e405b1784f0bfc9d4f6bd7d06f269f
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.
src/backend/utils/adt/xml.c