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

From: Noah Misch <noah(at)leadboat(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(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 00:32:56
Message-ID: 20130404003256.GA11248@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.)

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-04-04 00:39:25 Re: corrupt pages detected by enabling checksums
Previous Message Jeff Davis 2013-04-04 00:32:17 Re: corrupt pages detected by enabling checksums