Re: Bug in XPATH() produces invalid XML values and probably un-restorable dumps

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in XPATH() produces invalid XML values and probably un-restorable dumps
Date: 2011-06-09 18:00:31
Message-ID: FC60A4F5-5560-438C-97E8-B6D1FDE1CC2B@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May31, 2011, at 20:50 , Florian Pflug wrote:
> While trying to figure out sensible semantics for XPATH() and scalar-value returning XPath expressions, I've stumbled upon a bug in XPATH() that allows invalid XML values to be produced. This is a serious problem because should such invalid values get inserted into an XML column, an un-restorable dump ensues.
>
> Here's an example (REL9_0_STABLE as of a few days ago)
>
> template1=# SELECT (XPATH('/*/text()', '<root>&lt;</root>'))[1];
> xpath
> -------
> <
>
> ...
>
> Patch is attached.

I've added two tests to the xml regression test which highlight the issue.

Updated patch attached.

best regards,
Florian Pflug

Attachment Content-Type Size
pg_xpath_invalidxml.v2.patch application/octet-stream 3.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Ports 2011-06-09 18:03:20 Re: SSI work for 9.1
Previous Message Alvaro Herrera 2011-06-09 17:59:00 Re: Postmaster holding unlinked files for pg_largeobject table