Re: BUG #4912: server core dumps on xslt_process with empty param string - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4912: server core dumps on xslt_process with empty param string
Date
Msg-id 8761.1247180901@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4912: server core dumps on xslt_process with empty param string  ("Tom Bowden" <tom.bowden@fis-cal.com>)
List pgsql-bugs
"Tom Bowden" <tom.bowden@fis-cal.com> writes:
> I found that when using xslt_process(), either with two parameters, or with
> an empty/null third parameter -- that I get a 'server restarted' message.

Hm, I don't.

regression=# select xslt_process('<a/>','<b/>');
 xslt_process
--------------

(1 row)

regression=# select xslt_process('<a/>','<b/>', '');
 xslt_process
--------------

(1 row)

> To stop this behavior, I changed the source code in contrib/xml2/xslt_proc.c
> (around line 142) .. adding the following:
> if ( pstr == NULL ||  strlen(pstr) < 1 ) {
>           params[0] = NULL;
>           return;
> }

I can't see that this would fix anything.  A NULL value there is
impossible, and if the string is empty, the loop below should fall out
after properly setting param[0] to NULL.  It does look a bit
questionable whether the code does the right thing when MAXPARAMS gets
overrun, but I'm really not seeing what you're seeing.  Are you sure
you are using 8.4 and an 8.4 version of xml2?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #4913: Row missing from primary key index
Next
From: Tom Lane
Date:
Subject: Re: BUG #4913: Row missing from primary key index