postgresql/src/common
Tom Lane d8e1de899c Improve our response to invalid format strings, and detect more cases.
Places that are testing for *printf failure ought to include the format
string in their error reports, since bad-format-string is one of the
more likely causes of such failure.  This both makes it easier to find
and repair the mistake, and provides at least some useful info to the
user who stumbles across such a problem.

Also, tighten snprintf.c to report EINVAL for an invalid flag or
final character in a format %-spec (including the case where the
%-spec is missing a final character altogether).  This seems like
better project policy, and it also allows removing an instruction
or two from the hot code path.

Back-patch the error reporting change in pvsnprintf, since it should be
harmless and may be helpful; but not the snprintf.c change.

Per discussion of bug #15511 from Ertuğrul Kahveci, which reported an
invalid translated format string.  These changes don't fix that error,
but they should improve matters next time we make such a mistake.

Discussion: https://postgr.es/m/15511-1d8b6a0bc874112f@postgresql.org
2018-12-06 15:08:44 -05:00
..
unicode Update copyright for 2018 2018-01-02 23:30:12 -05:00
base64.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
config_info.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
controldata_utils.c Adjust error message 2018-06-11 17:19:11 -04:00
exec.c Enlarge find_other_exec's meager fgets buffer 2018-04-19 10:45:15 -03:00
fe_memutils.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
file_perm.c Fix incorrect ordering of operations in pg_resetwal and pg_rewind. 2018-05-23 10:59:55 -04:00
file_utils.c Revert "Allow concurrent-safe open() and fopen() in frontend code for Windows" 2018-09-18 17:28:27 -04:00
ip.c Clean up assorted misuses of snprintf()'s result value. 2018-08-15 16:29:32 -04:00
keywords.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
md5.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_lzcompress.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgfnames.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
psprintf.c Improve our response to invalid format strings, and detect more cases. 2018-12-06 15:08:44 -05:00
relpath.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
restricted_token.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
rmtree.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
saslprep.c Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
scram-common.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2_openssl.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
string.c restrict -> pg_restrict 2018-03-15 10:02:59 -03:00
unicode_norm.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
username.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
wait_error.c Update copyright for 2018 2018-01-02 23:30:12 -05:00