Re: Error in recent pg_dump change (coverity)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error in recent pg_dump change (coverity)
Date: 2006-05-28 17:40:09
Message-ID: 200605281740.k4SHe9R08155@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > > Tom Lane wrote:
> > >> Hm. But I think we'd *like* it to segfault; the idea is to make the
> > >> user's programming error as obvious as possible. Is it worth the
> > >> trouble to just zero out the pointer members of the PGresult?
> >
> > > There are only five of them; four need to be zeroed out.
> >
> > Works for me. Please commit, as I'm about to do some further work in
> > those files and would rather not have to merge ...
>
> Done. They were actually four, not five. The one I mistakingly though
> was one was the notice processor hooks.
>
> The case Martijn was saying would be warned about by the memset
> approach, setting ntuples to 0, would actually be handled as a segfault,
> because functions like check_field_number actually follow
> res.noticeHooks pointer! ISTM we would just segfault at that point.

Agreed. Anything to catch more errors is good.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-05-28 17:42:41 Re: Error in recent pg_dump change (coverity)
Previous Message Alvaro Herrera 2006-05-28 17:38:32 Re: Error in recent pg_dump change (coverity)