]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: fix pointer size when reporting data/transport layer name
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 14:21:26 +0000 (15:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 14:21:26 +0000 (15:21 +0100)
In dumpstats.c we have get_conn_xprt_name() and get_conn_data_name() to
report the name of the data and transport layers used on a connection.
But when the name is not known, its pointer is reported instead. But the
static char used to report the pointer is too small as it doesn't leave
room for '0x'. Fortunately all subsystems are known so we never trigger
this case.

This fix needs to be backported to 1.6 and 1.5.

src/dumpstats.c

index e9ae9e885a7e9bdc2c8118fe313d5487bf3216af..e22d0744c46153db03c40f94f2a22f11f7b5f48d 100644 (file)
@@ -5854,7 +5854,7 @@ static inline const char *get_conn_ctrl_name(const struct connection *conn)
 
 static inline const char *get_conn_xprt_name(const struct connection *conn)
 {
-       static char ptr[17];
+       static char ptr[19];
 
        if (!conn_xprt_ready(conn))
                return "NONE";
@@ -5872,7 +5872,7 @@ static inline const char *get_conn_xprt_name(const struct connection *conn)
 
 static inline const char *get_conn_data_name(const struct connection *conn)
 {
-       static char ptr[17];
+       static char ptr[19];
 
        if (!conn->data)
                return "NONE";