pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Ensure that snprintf.c's fmtint() doesn't overflow when printing
3+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2018-10-03 d173652797  Replace uint64 use introduced in 4868e446859 in light of 595a0eab7f42.
* pgsql: Ensure that snprintf.c's fmtint() doesn't overflow when printing
@ 2018-10-03 20:16  Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Andres Freund @ 2018-10-03 20:16 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Ensure that snprintf.c's fmtint() doesn't overflow when printing INT64_MIN.

This isn't actually a live bug, as the output happens to be the
same.  But it upsets tools like UBSan, which makes it worthwhile to
fix.

As it's an issue without practical consequences, don't backpatch.

Author: Andres Freund
Discussion: https://postgr.es/m/20180928001121.hhx5n6dsygqxr5wu@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4868e4468590bc32f9c3afed4ec795d6a7732c9d

Modified Files
--------------
src/port/snprintf.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Ensure that snprintf.c's fmtint() doesn't overflow when printing
@ 2018-10-03 20:24  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-10-03 20:24 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers@lists.postgresql.org

Andres Freund <andres@anarazel.de> writes:
> Ensure that snprintf.c's fmtint() doesn't overflow when printing INT64_MIN.

Hm, I think you should s/uint64/unsigned long long/ to be consistent
with 595a0eab7.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Ensure that snprintf.c's fmtint() doesn't overflow when printing
@ 2018-10-03 20:30  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Andres Freund @ 2018-10-03 20:30 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

Hi,

On 2018-10-03 16:24:23 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Ensure that snprintf.c's fmtint() doesn't overflow when printing INT64_MIN.
> 
> Hm, I think you should s/uint64/unsigned long long/ to be consistent
> with 595a0eab7.

Fair point. Will push once tests finish.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-10-03 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 20:16 pgsql: Ensure that snprintf.c's fmtint() doesn't overflow when printing Andres Freund <andres@anarazel.de>
2018-10-03 20:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-10-03 20:30   ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox