pgpool2.git / summary / log / commit / refs
commit 230557a3ea54ef0de48643379b3cdf7bba02705d
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Thu Aug 16 06:38:33 2018 +0000
Fix too small buffer size in some configuration file process.
This was found by newer version of gcc warnings.
pool_config_variables.c: In function ‘BackendFlagsShowFunc’:
pool_config_variables.c:3809:57: warning: ‘__builtin_snprintf’ output truncated before the last format character [-Wformat-truncation=]
snprintf(buffer, sizeof(buffer), "DISALLOW_TO_FAILOVER");
^
In file included from /usr/include/stdio.h:862:0,
from pool_config_variables.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin_snprintf’ output 21 bytes into a destination of size 20
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/config/pool_config_variables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c
index 638093e39..8778d7b0c 100644
--- a/src/config/pool_config_variables.c
+++ b/src/config/pool_config_variables.c
@@ -3800,7 +3800,7 @@ static const char* BackendDataDirShowFunc(int index)
static const char* BackendFlagsShowFunc(int index)
{
- static char buffer[20];
+ static char buffer[21];
unsigned short flag = g_pool_config.backend_desc->backend_info[index].flag;
if (POOL_ALLOW_TO_FAILOVER(flag))
[parent: e2147a26a568]