From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <andy@warmcat.com>
Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82])
 by dpdk.org (Postfix) with ESMTP id 507311C6A6
 for <dev@dpdk.org>; Mon, 14 May 2018 07:01:16 +0200 (CEST)
From: Andy Green <andy@warmcat.com>
To: dev@dpdk.org
Date: Mon, 14 May 2018 13:01:12 +0800
Message-ID: <152627407240.52758.12345283817005640967.stgit@localhost.localdomain>
In-Reply-To: <152627394448.52758.15834703911138407294.stgit@localhost.localdomain>
References: <152627394448.52758.15834703911138407294.stgit@localhost.localdomain>
User-Agent: StGit/unknown-version
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: [dpdk-dev] [PATCH v6 16/16] app/test-bbdev: strcpy ok for allocated
	string
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 14 May 2018 05:01:16 -0000

Signed-off-by: Andy Green <andy@warmcat.com>
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org
---
 app/test-bbdev/test_bbdev_vector.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index c574f2135..81b8ee78f 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -891,7 +891,6 @@ test_bbdev_vector_read(const char *filename,
 			goto exit;
 		}
 
-		memset(entry, 0, strlen(line) + 1);
 		strcpy(entry, line);
 
 		/* check if entry ends with , or = */
@@ -914,7 +913,8 @@ test_bbdev_vector_read(const char *filename,
 				}
 
 				entry = entry_extended;
-				strncat(entry, line, strlen(line));
+				/* entry has been allocated accordingly */
+				strcpy(&entry[strlen(entry)], line);
 
 				if (entry[strlen(entry) - 1] != ',')
 					break;