Re: Error in recent pg_dump change (coverity)

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error in recent pg_dump change (coverity)
Date: 2006-05-28 16:13:34
Message-ID: 20060528161334.GC22869@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 28, 2006 at 12:00:33PM -0400, Tom Lane wrote:
> Another possibility is to just MemSet the whole PGresult struct
> to zeroes before free'ing it. Compared to the cost of obtaining
> a query result from the backend, this probably doesn't cost enough
> to be worth worrying about, and it would catch a few more problems
> of the same ilk.

Probably better actually, since by setting ntups to zero also,
PQgetvalue will return a warning (row number out of range) rather than
segfaulting...

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-28 16:19:10 Re: Error in recent pg_dump change (coverity)
Previous Message Martijn van Oosterhout 2006-05-28 16:01:11 Re: Error in recent pg_dump change (coverity)