Re: BUG #4912: server core dumps on xslt_process with empty param string

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tom Bowden" <tom(dot)bowden(at)fis-cal(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4912: server core dumps on xslt_process with empty param string
Date: 2009-07-09 23:08:21
Message-ID: 8761.1247180901@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Tom Bowden" <tom(dot)bowden(at)fis-cal(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-07-09 23:13:36 Re: BUG #4913: Row missing from primary key index
Previous Message Andrew Gierth 2009-07-09 22:29:56 Re: BUG #4913: Row missing from primary key index