Re: Regex with > 32k different chars causes a backend crash

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regex with > 32k different chars causes a backend crash
Date: 2013-04-04 16:53:13
Message-ID: 515DAFF9.2060505@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.04.2013 03:32, Noah Misch wrote:
> On Wed, Apr 03, 2013 at 08:09:15PM +0300, Heikki Linnakangas wrote:
>> --- a/src/include/regex/regguts.h
>> +++ b/src/include/regex/regguts.h
>> @@ -148,6 +148,7 @@
>> typedef short color; /* colors of characters */
>> typedef int pcolor; /* what color promotes to */
>>
>> +#define MAX_COLOR 32767 /* max value that fits in 'color' datatype */
>
> This should use SHRT_MAX, no? (Not that any supported platform differs here.)

I considered that, but I got all confused on whether limits.h needs to
be included and where, if we use that. So I just used a constant 32767
in the end. Committed that way.

I opened a ticket in TCL bug tracker for this:
https://sourceforge.net/tracker/?func=detail&aid=3610026&group_id=10894&atid=110894.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-04-04 16:56:37 Re: psql crash fix
Previous Message Simon Riggs 2013-04-04 16:46:46 Re: corrupt pages detected by enabling checksums