Remove FATAL from pg_lzdecompress

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Remove FATAL from pg_lzdecompress
Date: 2008-02-29 20:39:58
Message-ID: 47C86D9E.2000909@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


I attach patch which adds boundaries check and memory overwriting
protection when compressed data are corrupted.

Current behavior let code overwrite a memory and after that check if
unpacked size is same as expected value. In this case elog execution
fails (at least on Solaris - malloc has corrupted structures) and no
message appears in a log file.

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 also think that this modification should be backported to other
version too.

Thanks Zdenek

Attachment Content-Type Size
lztoast.diff text/x-patch 2.3 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-02-29 20:40:13 Re: DTrace probe patch for OS X Leopard
Previous Message Robert Lor 2008-02-29 20:38:54 Re: DTrace probe patch for OS X Leopard