Re: [PATCH] Fix off-by-one in PQprintTuples() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Fix off-by-one in PQprintTuples()
Date
Msg-id 7796.1358741504@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Fix off-by-one in PQprintTuples()  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> Strictly speaking, it's this:

> tborder[i] = '\0';

> Which ends up writing past the end of the buffer (which is allocated as
> 'width + 1').  Perhaps we should also change that to be:

> tborder[width] = '\0';

Yeah, I like that better too.  Will commit.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [WIP] pg_ping utility
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: fix corner use case of variadic fuctions usage