From: Ruben Kerkhof Date: Mon, 14 May 2018 20:08:35 +0000 (+0200) Subject: write_sensu plugin: use the right size for buffer X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=19a72a3f6b64176aeeb6c64ccaa324872b1c2996;p=collectd.git write_sensu plugin: use the right size for buffer I missed that r is a pointer, not an array. Fixes CID #185580 --- diff --git a/src/write_sensu.c b/src/write_sensu.c index cf6a6bda..bda33278 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -626,7 +626,7 @@ static char *replace_str(const char *str, const char *old, /* {{{ */ r += newlen; p = q + oldlen; } - sstrncpy(r, p, sizeof(r)); + sstrncpy(r, p, retlen + 1); return ret; } /* }}} char *replace_str */