Fix buffer over run problem in "show pool_nodes".
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 24 Jun 2016 06:56:01 +0000 (15:56 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 24 Jun 2016 07:54:05 +0000 (16:54 +0900)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).

pcp/libpcp_ext.h

index 09cd196e7366a4c55f27d8ccc4b57d8e116ae7ce..274d150933a0072b816afabaf1b514b9cdaef0dd 100644 (file)
@@ -187,7 +187,7 @@ typedef struct {
 /* nodes report struct */
 typedef struct {
        char node_id[POOLCONFIG_MAXIDLEN+1];
-       char hostname[POOLCONFIG_MAXIDENTLEN+1];
+       char hostname[MAX_DB_HOST_NAMELEN+1];
        char port[POOLCONFIG_MAXPORTLEN+1];
        char status[POOLCONFIG_MAXSTATLEN+1];
        char lb_weight[POOLCONFIG_MAXWEIGHTLEN+1];