> On Nov 13, 2026, at 18:37, Peter Eisentraut <[email protected]> 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.
> <0001-Remove-strftime-workarounds-for-Wformat-y2k.patch><0002-Remove-strftime-workaround-for-MinGW.patch><0003-Fix-Wformat-nonliteral-warnings.patch><0004-Disable-some-Wformat-nonliteral-warnings-via-pragmas.patch><0005-Add-warning-option-Wformat-nonliteral.patch>
I tried to build with the patch set on my MacBook, no warnings found.
Overall the patch looks good to me. 0003 seems to add some redundant code, but
other than using some macros to mitigate the redundancy, I don’t see other
better ways. As you mentioned, that doesn’t blow the code very much, so,
introducing new macros might just add unnecessary complexities.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/