Unix Technical Forum

Minor patch to contrib/xml2

This is a discussion on Minor patch to contrib/xml2 within the Pgsql Patches forums, part of the PostgreSQL category; --> Hi all, The following patch is small, but given the current point in the cycle I fully understand that ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:57 PM
John Gray
 
Posts: n/a
Default Minor patch to contrib/xml2

Hi all,

The following patch is small, but given the current point in the cycle I
fully understand that it may be held for an 8.0.1 or 8.1. I'm sorry that I
didn't stumble across it sooner...

It fixes a segfault due to the XML parser not being cleared up as required
when the xpath_list function is applied to an invalid document. The change
just ensures that the early exit (on NULL input) from the
pgxml_result_to_text function calls xmlCleanupParser, as the main exit
does.

Regards

John Gray


Index: contrib/xml2/xpath.c
================================================== =================
RCS file: /projects/cvsroot/pgsql/contrib/xml2/xpath.c,v
retrieving revision 1.5
diff -c -r1.5 xpath.c
*** contrib/xml2/xpath.c 2 Dec 2004 22:21:12 -0000 1.5
--- contrib/xml2/xpath.c 9 Jan 2005 17:17:06 -0000
***************
*** 582,588 ****
--- 582,591 ----
text *xpres;

if (res == NULL)
+ {
+ xmlCleanupParser();
return NULL;
+ }
switch (res->type)
{
case XPATH_NODESET:

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:57 PM
Tom Lane
 
Posts: n/a
Default Re: Minor patch to contrib/xml2

John Gray <jgray@azuli.co.uk> writes:
> The following patch is small, but given the current point in the cycle I
> fully understand that it may be held for an 8.0.1 or 8.1. I'm sorry that I
> didn't stumble across it sooner...


> It fixes a segfault due to the XML parser not being cleared up as required
> when the xpath_list function is applied to an invalid document.


It's not too late to fix segfaults, especially not in contrib stuff.
Patch applied.

(BTW, please try to ensure that your mailer doesn't munge whitespace in
patches --- I had to do this one by hand because "patch" wouldn't match
it up. Attaching the patch as a separate file may be safest.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:38 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com