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:53:54 +0000 (16:53 +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 b65ec4742315af3ca64cd0fe3b8ecc7f89421cb3..635d19aa5474c2523cb7a2a58d85a4cf6acab499 100644 (file)
@@ -186,7 +186,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];