summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-08-18 19:11:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-08-18 19:22:07 +0200
commit09d14955e436b144bc69b998c172b3ea47683195 (patch)
treed8df97f7260728d0310f99e9f9170259db96512f
parent743e4948eb3bdbdb3a7751c54f2c715ba829afd2 (diff)
downloadconntrack-tools-09d14955e436b144bc69b998c172b3ea47683195.tar.gz
conntrack-tools-09d14955e436b144bc69b998c172b3ea47683195.zip
conntrackd: use strncpy to set up the cache name
This is not exposed, but use the strncpy() variant to calm down static code validators. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index 7c41e54..79a024f 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -34,7 +34,7 @@ struct cache_feature *cache_feature[CACHE_MAX_FEATURE] = {
};
struct cache *cache_create(const char *name, enum cache_type type,
- unsigned int features,
+ unsigned int features,
struct cache_extra *extra,
struct cache_ops *ops)
{
@@ -53,7 +53,8 @@ struct cache *cache_create(const char *name, enum cache_type type,
return NULL;
memset(c, 0, sizeof(struct cache));
- strcpy(c->name, name);
+ strncpy(c->name, name, CACHE_MAX_NAMELEN);
+ c->name[CACHE_MAX_NAMELEN - 1] = '\0';
c->type = type;
for (i = 0; i < CACHE_MAX_FEATURE; i++) {