Re: [PATCH] Fix off-by-one in PQprintTuples()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Xi Wang <xi(dot)wang(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Fix off-by-one in PQprintTuples()
Date: 2013-01-21 04:11:44
Message-ID: 7796.1358741504@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-21 05:04:55 Re: proposal: fix corner use case of variadic fuctions usage
Previous Message Chris Travers 2013-01-21 03:55:01 Re: Re: [HACKERS] Overly strict casting rules? (was: proposal: fix corner use case of variadic fuctions usage)