From 2e53911bb32745221fdc077d06237abc44ad9962 Mon Sep 17 00:00:00 2001 From: Anand B Jyoti Date: Wed, 4 Oct 2017 10:15:40 +0530 Subject: VNFs: Fixing klocwork issue in VNFs code JIRA: SAMPLEVNF-83 This patch fixes the klocwork reported issues Change-Id: I190d024777be1bf53cdc97feca1e5934781f3582 Signed-off-by: Anand B Jyoti --- VNFs/vACL/pipeline/pipeline_acl_be.c | 4 ++-- VNFs/vACL/pipeline/pipeline_acl_be.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'VNFs/vACL/pipeline') diff --git a/VNFs/vACL/pipeline/pipeline_acl_be.c b/VNFs/vACL/pipeline/pipeline_acl_be.c index d3fa0519..512c2f64 100644 --- a/VNFs/vACL/pipeline/pipeline_acl_be.c +++ b/VNFs/vACL/pipeline/pipeline_acl_be.c @@ -2638,7 +2638,7 @@ static void *pipeline_acl_init(struct pipeline_params *params, if (p == NULL) return NULL; - strcpy(p->name, params->name); + strncpy(p->name, params->name, PIPELINE_NAME_SIZE); p->log_level = params->log_level; PLOG(p, HIGH, "ACL"); @@ -2681,7 +2681,7 @@ static void *pipeline_acl_init(struct pipeline_params *params, rte_ACL_hi_counter_block_in_use++; counter_ptr = &rte_acl_counter_table[rte_ACL_hi_counter_block_in_use]; - strcpy(counter_ptr->name, params->name); + strncpy(counter_ptr->name, params->name,PIPELINE_NAME_SIZE); p_acl->action_counter_index = rte_ACL_hi_counter_block_in_use; p_acl->counters = counter_ptr; diff --git a/VNFs/vACL/pipeline/pipeline_acl_be.h b/VNFs/vACL/pipeline/pipeline_acl_be.h index bbb20e82..edce7e4c 100644 --- a/VNFs/vACL/pipeline/pipeline_acl_be.h +++ b/VNFs/vACL/pipeline/pipeline_acl_be.h @@ -64,7 +64,7 @@ extern uint8_t ACL_DEBUG; * One counter block per ACL Thread */ struct rte_ACL_counter_block { - char name[32]; + char name[PIPELINE_NAME_SIZE]; /* as long as a counter doesn't cross cache line, writes are atomic */ uint64_t tpkts_processed; uint64_t bytes_processed; /* includes all L3 and higher headers */ -- cgit 1.2.3-korg