Skip site navigation (1) Skip section navigation (2)

Re: BUG #2895: Private Use Unicode character crashes server when using ILIKE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: James Russell <internationalhobo(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2895: Private Use Unicode character crashes server when using ILIKE
Date: 2007-01-24 03:24:51
Message-ID: 9370.1169609091@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Michael Fuhr <mike(at)fuhr(dot)org> writes:
> The crash seems to happen only with code points that have UTF-8
> byte sequences of more than three bytes (U+10000 and higher).
> Here's an example that segfaults in 8.1.6 on the Linux box:

> select e'\360\220\200\200' ilike e'%\342\204\242';

Well, tracing through it I still don't get a crash, but I see where it's
stomping on stack :-(.  pg_utf_mblen() and pg_utf8_islegal() allow
4-byte utf8 sequences, but pg_utf2wchar_with_len() only supports 3!
I'm surprised we've not seen reports of other problems.  The lack of
crash in 8.2 is because iwchareq went away completely, but that's
certainly not the only place doing conversions to pg_wchar and expecting
the result to fit in a prespecified buffer ...

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-01-24 03:35:59
Subject: Re: BUG #2895: Private Use Unicode character crashes server when using ILIKE
Previous:From: Michael FuhrDate: 2007-01-24 02:55:23
Subject: Re: BUG #2895: Private Use Unicode character crashes server when using ILIKE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group