Re: Remove FATAL from pg_lzdecompress - Mailing list pgsql-patches

From Tom Lane
Subject Re: Remove FATAL from pg_lzdecompress
Date
Msg-id 12595.1204938791@sss.pgh.pa.us
Whole thread Raw
In response to Remove FATAL from pg_lzdecompress  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: Remove FATAL from pg_lzdecompress  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-patches
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> I attach patch which adds boundaries check and memory overwriting
> protection when compressed data are corrupted.

Applied with revisions --- it appeared to me that it got the corner case
wrong where we find a tag just at the end of the input but there's no
room for the output.  We'd fall out of the loop and then the error
test would think all is well.

> I did not add any extra information into the message. Reasonable
> solution seems to be use errcontext how was recommended by Alvaro. But I
> 'm not sure if printtup is good place for it, because pg_detoast is
> called from many places. However, is can be solved in separate patch.

I'm still unconvinced that that's worth any added complexity or
slowdown.

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: CopyReadAttributesCSV optimization
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: CopyReadLineText optimization