Buffer overflow in contrib/test_parser/test_parser.c

Paul Guyot <pguyot@kallisys.net>

From: Paul Guyot <pguyot@kallisys.net>
To: pgsql-hackers@postgresql.org
Date: 2012-01-09T23:18:59Z
Lists: pgsql-hackers

Attachments

Hello,

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.

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

Paul
-- 
Semiocast            http://semiocast.com/
+33.183627948 - 20 rue Lacaze, 75014 Paris