From e66e94fefa26f6970449dc7b7c4e965352e027b0 Mon Sep 17 00:00:00 2001 From: Marek Schimara Date: Wed, 15 Jun 2016 16:30:32 +0200 Subject: [PATCH] src/rrd_create.c: fix Coverity CID#32400 Buffer not null terminated CWE-170 / https://cwe.mitre.org/data/definitions/170.html --- src/rrd_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rrd_create.c b/src/rrd_create.c index 531b85c3..e29beddb 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -381,11 +381,11 @@ int parseDS(const char *def, case DST_DERIVE: case DST_DCOUNTER: case DST_DDERIVE: - strncpy(ds_def->dst, dst_tmp, DST_SIZE); + strncpy(ds_def->dst, dst_tmp, DST_SIZE - 1); parseGENERIC_DS(dst_args, ds_def); break; case DST_CDEF: - strncpy(ds_def->dst, dst_tmp, DST_SIZE); + strncpy(ds_def->dst, dst_tmp, DST_SIZE - 1); parseCDEF_DS(dst_args, ds_def, key_hash, lookup); break; default: -- 2.47.3