Gianni Ciolli wrote:
> On Tue, Oct 28, 2008 at 08:59:53PM +0100, Magnus Hagander wrote:
>> The attached patch tries to implement regexp support in the usermaps
> Hi Magnus,
> I am currently reviewing your patch.
Thanks for the review!
> I found out that the execution of
> (there's only one such line in your patch) might raise on the current
> HEAD the following message
> WARNING: detected write past chunk end in Postmaster 0x9b13650
Yes, that's a stupid bug:
- /* length: original length minus length of \1
plus length of match */
- regexp_pgrole =
+ /* length: original length minus length of \1
plus length of match plus null terminator */
+ regexp_pgrole = palloc0(strlen(file_pgrole) - 2
+ (matches.rm_eo-matches.rm_so) + 1);
Two bugs: the length calculation used the start of the string vs the
start of the string, instead of end vs start. And there was no room for
the NULL terminator.
Attached is an updated version of the patch that fixes this.
In response to
pgsql-hackers by date
|Next:||From: Sergey Konoplev||Date: 2008-11-11 14:03:44|
|Subject: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)|
|Previous:||From: Alvaro Herrera||Date: 2008-11-11 13:44:12|
|Subject: Re: Duplicated docs on libpq parameters|