From 5fdcca48142f4a18ac2c6345e463ca6398b5d34f Mon Sep 17 00:00:00 2001 From: Boian Bonev Date: Tue, 1 Dec 2020 04:07:22 +0200 Subject: [PATCH] Increase buffer size to avoid possible truncation: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC bmon-in_netlink.o in_netlink.c: In function ‘handle_tc_obj’: in_netlink.c:558:37: warning: ‘ (’ directive output may be truncated writing 2 bytes into a region of size between 0 and 31 [-Wformat-truncation=] 558 | snprintf(name, sizeof(name), "%s %s (%s)", | ^~ in_netlink.c:558:2: note: ‘snprintf’ output 5 or more bytes (assuming 36) into a destination of size 32 558 | snprintf(name, sizeof(name), "%s %s (%s)", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 559 | prefix, buf, rtnl_tc_get_kind(tc)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CCLD bmon --- src/in_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/in_netlink.c b/src/in_netlink.c index 4b5e3b1..3f84e3b 100644 --- a/src/in_netlink.c +++ b/src/in_netlink.c @@ -550,7 +550,7 @@ static void find_qdiscs(int, uint32_t, struct rdata *); static struct element *handle_tc_obj(struct rtnl_tc *tc, const char *prefix, const struct rdata *rdata) { - char buf[IFNAME_MAX], name[IFNAME_MAX]; + char buf[IFNAME_MAX], name[IFNAME_MAX + 6]; uint32_t id = rtnl_tc_get_handle(tc); struct element *e;