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

Andres Freund <andres@anarazel.de>

Commit: 4868e4468590bc32f9c3afed4ec795d6a7732c9d
Author: Andres Freund <andres@anarazel.de>
Date: 2018-10-03T20:13:50Z
Releases: 12.0
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

Files

PathChange+/−
src/port/snprintf.c modified +4 −3

Discussion