Re: Buffer overflow in contrib/test_parser/test_parser.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Guyot <pguyot(at)kallisys(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Buffer overflow in contrib/test_parser/test_parser.c
Date: 2012-01-10 00:40:51
Message-ID: 7426.1326156051@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Paul Guyot <pguyot(at)kallisys(dot)net> writes:
> There is a buffer overflow in sample code's test_parser.c that can yield to a segmentation fault. The next byte of the buffer is tested against ' ' before its availability is checked.

Hmm, yeah. The probability of a failure is very low of course, but
still it'd be better if the sample code didn't have bugs like this.

> You will find attached a simple patch that fixes the bug.

Will apply, thank you.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2012-01-10 02:51:30 Re: 16-bit page checksums for 9.2
Previous Message Jim Nasby 2012-01-10 00:24:33 Re: LWLOCK_STATS