pgsql: Fix one-byte buffer overrun in contrib/test_parser. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix one-byte buffer overrun in contrib/test_parser.
Date
Msg-id E1RkQ3J-0005by-I1@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix one-byte buffer overrun in contrib/test_parser.

The original coding examined the next character before verifying that
there *is* a next character.  In the worst case with the input buffer
right up against the end of memory, this would result in a segfault.

Problem spotted by Paul Guyot; this commit extends his patch to fix an
additional case.  In addition, make the code a tad more readable by not
overloading the usage of *tlen.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e3fce282b5d507b8105c26543b079bc279da4000

Modified Files
--------------
contrib/test_parser/test_parser.c |   19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix one-byte buffer overrun in contrib/test_parser.
Next
From: fxjr@pgfoundry.org (User Fxjr)
Date:
Subject: npgsql - Npgsql2: Fixed tabulation.