Re: Buffer overflow in contrib/test_parser/test_parser.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Buffer overflow in contrib/test_parser/test_parser.c
Date
Msg-id 7426.1326156051@sss.pgh.pa.us
Whole thread Raw
In response to Buffer overflow in contrib/test_parser/test_parser.c  (Paul Guyot <pguyot@kallisys.net>)
List pgsql-hackers
Paul Guyot <pguyot@kallisys.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
thebuffer 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


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: LWLOCK_STATS
Next
From: Jim Nasby
Date:
Subject: Re: 16-bit page checksums for 9.2