summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-10-13 17:56:45 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-10-13 17:56:45 -0400
commit03bf7a12c5a44ced377352c8f9bf6e9f4b863885 (patch)
tree727972523df20db53ca67a1041591b1262770012 /src/include
parent615a0fc2f1fd30df863b0dde2c045eaab8018ec6 (diff)
Fix incorrect message-printing in win32security.c.
log_error() would probably fail completely if used, and would certainly print garbage for anything that needed to be interpolated into the message, because it was failing to use the correct printing subroutine for a va_list argument. This bug likely went undetected because the error cases this code is used for are rarely exercised - they only occur when Windows security API calls fail catastrophically (out of memory, security subsystem corruption, etc). The FRONTEND variant can be fixed just by calling vfprintf() instead of fprintf(). However, there was no va_list variant of write_stderr(), so create one by refactoring that function. Following the usual naming convention for such things, call it vwrite_stderr(). Author: Bryan Green <dbryan.green@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAF+pBj8goe4fRmZ0V3Cs6eyWzYLvK+HvFLYEYWG=TzaM+tWPnw@mail.gmail.com Backpatch-through: 13
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/elog.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 348dafbf906..001ab93ae6c 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -528,5 +528,6 @@ extern void write_jsonlog(ErrorData *edata);
* safely (memory context, GUC load etc)
*/
extern void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
+extern void vwrite_stderr(const char *fmt, va_list ap) pg_attribute_printf(1, 0);
#endif /* ELOG_H */