Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL (fwd) - Mailing list pgsql-hackers

From Neil Conway
Subject Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL (fwd)
Date
Msg-id 877kilb69s.fsf@mailbox.samurai.com
Whole thread Raw
In response to Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL (fwd)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL
Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Neil Conway <neilc@samurai.com> writes:
> > +     /* Check for integer overflow */
> > +     if (tlen / slen != count)
> > +         elog(ERROR, "Requested buffer is too large.");
>
> What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in