pgsql: Fix some more bugs in contrib/xml2's xslt_process().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some more bugs in contrib/xml2's xslt_process().
Date: 2012-06-05 00:13:54
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix some more bugs in contrib/xml2's xslt_process().

It failed to check for error return from xsltApplyStylesheet(), as reported
by Peter Gagarinov. (So far as I can tell, libxslt provides no convenient
way to get a useful error message in failure cases. There might be some
inconvenient way, but considering that this code is deprecated it's hard to
get enthusiastic about putting lots of work into it. So I just made it say
"failed to apply stylesheet", in line with the existing error checks.)

While looking at the code I also noticed that the string returned by
xsltSaveResultToString was never freed, resulting in a session-lifespan
memory leak.

Back-patch to all supported versions.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/110ebff20972101236b27c876c14e6df2833b571

Modified Files
--------------
contrib/xml2/xslt_proc.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-06-05 00:44:03 pgsql: Fix bogus handling of control characters in json_lex_string().
Previous Message Christopher Browne 2012-06-04 19:49:37 Re: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.