pgpool2.git / summary / log / commit / refs
commit f84158903cff425f2e24821f423523bb2a7c3d9f
Author: Tatsuo Ishii <ishii@postgresql.org>
Commit: Muhammad Usama <m.usama@gmail.com>
Date: Fri Nov 22 12:43:43 2013 +0000
Fix strftime() usage in pool_pools().
The buffer is not large enough as expected by the second parameter.
This is not harmless because the format string will not produce longer
result string than the buffer.
Per Coverity report 1111426 "Out-of-bounds access".
src/utils/pool_process_reporting.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/utils/pool_process_reporting.c b/src/utils/pool_process_reporting.c
index 2cbd48ae1..da8f19a1b 100644
--- a/src/utils/pool_process_reporting.c
+++ b/src/utils/pool_process_reporting.c
@@ -1231,11 +1231,11 @@ void pools_reporting(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend)
snprintf(proc_pid, sizeof(proc_pid), "%d", pools[i].pool_pid);
snprintf(pool_id, sizeof(pool_id), "%d", pools[i].pool_id);
if (pools[i].start_time)
- strftime(proc_start_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pools[i].start_time));
+ strftime(proc_start_time, sizeof(proc_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pools[i].start_time));
else
*proc_start_time = '\0';
if (pools[i].create_time)
- strftime(proc_create_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pools[i].create_time));
+ strftime(proc_create_time, sizeof(proc_create_time), "%Y-%m-%d %H:%M:%S", localtime(&pools[i].create_time));
else
*proc_create_time = '\0';
snprintf(majorversion, sizeof(majorversion), "%d", pools[i].pool_majorversion);
[parent: bc6693f283d3]