Re: @(#)Mordre Labs advisory 0x0005: Several buffer overruns in PostgreSQL - Mailing list pgsql-hackers

From Neil Conway
Subject Re: @(#)Mordre Labs advisory 0x0005: Several buffer overruns in PostgreSQL
Date
Msg-id 87elcidcji.fsf@mailbox.samurai.com
Whole thread Raw
In response to @(#)Mordre Labs advisory 0x0005: Several buffer overruns in PostgreSQL  (Sir Mordred The Traitor <mordred@s-mail.com>)
Responses Re: @(#)Mordre Labs advisory 0x0005: Several buffer overruns  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: @(#)Mordre Labs advisory 0x0005: Several buffer overruns  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Sir Mordred The Traitor <mordred@s-mail.com> writes:
> Upon invoking a polygon(integer, circle) function a
> src/backend/utils/adt/geo_ops.c:circle_poly() function will gets
> called, which suffers from a buffer overflow.
>
> 2) A src/backend/adt/utils/geo_ops.c:path_encode() fails to detect a
> buffer overrun condition. It is called in multiple places, the most
> interesting are path_out() and poly_out() functions.

> 5) A src/backend/utils/adt/geo_ops.c:path_add() also fails to detect
> a simple buffer overrun.

I've attached a patch which should fix these problems.

> 3) Upon converting a char string to a path object, a
> src/backend/utils/adt/geo_ops.c:path_in() function will gets called,
> which suffers from a buffer overrun, caused by a very long argument.

> 4) A src/backend/utils/adt/geo_ops.c:poly_in() function fails to
> detect a buffer overrun condition caused by a very long argument.

I wasn't able to reproduce either of these (wouldn't it require an
input string with several hundred thousand commas?), can you give me a
test-case?

Cheers,

Neil

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

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Proposed GUC Variable
Next
From: Peter Eisentraut
Date:
Subject: Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?