From 9caada19222a23030ee171d7be9b277c5cebfc1e Mon Sep 17 00:00:00 2001 From: Aleksei Zakharov Date: Thu, 12 Oct 2017 10:43:54 +0000 Subject: [PATCH 1/1] Add sstrncpy if count_parts>2 but no suffix --- src/ceph.c | 2 ++ 1 file changed, 2 insertions(+) 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)); -- 2.11.0