From: Marek Schimara Date: Wed, 15 Jun 2016 14:30:32 +0000 (+0200) Subject: src/rrd_create.c: fix Coverity CID#32400 Buffer not null terminated X-Git-Tag: v1.7.0~42^2~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e66e94fefa26f6970449dc7b7c4e965352e027b0;p=thirdparty%2Frrdtool-1.x.git src/rrd_create.c: fix Coverity CID#32400 Buffer not null terminated CWE-170 / https://cwe.mitre.org/data/definitions/170.html --- 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: