From: Aleksei Zakharov Date: Thu, 12 Oct 2017 10:43:54 +0000 (+0000) Subject: Add sstrncpy if count_parts>2 but no suffix X-Git-Tag: collectd-5.8.0~29^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9caada19222a23030ee171d7be9b277c5cebfc1e;p=collectd.git Add sstrncpy if count_parts>2 but no suffix --- diff --git a/src/ceph.c b/src/ceph.c index 421c7eff..523bc75f 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -532,6 +532,8 @@ static int parse_keys(char *buffer, size_t buffer_size, const char *key_str) { cut_suffix(tmp, tmp_size, key_str, ".sum"); } else if (has_suffix(key_str, ".avgtime")) { cut_suffix(tmp, tmp_size, key_str, ".avgtime"); + } else { + sstrncpy(tmp, key_str, sizeof(tmp)); } } else { sstrncpy(tmp, key_str, sizeof(tmp));