On 2026-11-13 Fr 5:37 AM, Peter Eisentraut wrote:
This is a follow-up to CVE-2026-16240 (commit 4a18e9b5f36).
That issue was found by -Wformat-nonliteral. That warning option
flags a bunch of other places, which were fortunately not security
issues. I think this is quite a large surface area to leave
unchecked. I propose to fix these and turn this warning option on by
default. While this does require introducing a bit more duplication,
the patch (see patch 0003) overall does not blow up the code much at
all (911 insertions(+), 896 deletions(-)).
This also runs into some workarounds we had installed for strftime by
explicitly *not* using literal format strings. The y2k-related one of
these is definitely obsolete and can be removed (see patch 0001). The
MinGW-related one (see patch 0002) is also obsolescent if we want to
assume gcc 14+ for MinGW. I think for MinGW we tend to opt for only
supporting recent toolchains, so this might be ok. Otherwise, we
could work around this with some pragmas.
The only buildfarm animal doing mingw is fairywren, and it's using UCRT
with gcc-16.2. So from that POV I think patches 0001 and 0002 should be
fine.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com