coverity: #1425855

String not null terminated Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent ad141c3d
......@@ -178,6 +178,7 @@ static void print_net_stats(struct lxc_container *c)
rc = lxc_read_from_file(path, buf, sizeof(buf));
if (rc > 0) {
buf[rc - 1] = '\0';
str_chomp(buf);
rx_bytes = str_size_humanize(buf, sizeof(buf));
printf("%-15s %s\n", " TX bytes:", buf);
......@@ -190,6 +191,7 @@ static void print_net_stats(struct lxc_container *c)
rc = lxc_read_from_file(path, buf, sizeof(buf));
if (rc > 0) {
buf[rc - 1] = '\0';
str_chomp(buf);
tx_bytes = str_size_humanize(buf, sizeof(buf));
printf("%-15s %s\n", " RX bytes:", buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment