[dpdk-stable] patch 'app/crypto-perf: use strcpy for allocated string' has been queued to stable release 18.02.2
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed May 23 14:09:47 CEST 2018
Hi,
FYI, your patch has been queued to stable release 18.02.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From 7e35818f4cf31e46e3f5e4bfd6e985a6fae92015 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Date: Wed, 16 May 2018 17:58:03 +0530
Subject: [PATCH] app/crypto-perf: use strcpy for allocated string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 21f579fcefd3ac21d1894be662f774cf48bb914e ]
inlined from ‘cperf_test_vector_get_from_file’ at
app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
strncpy(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
‘strncat’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
strncat(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found this issue with meson build and gcc 8.1.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
app/test-crypto-perf/cperf_test_vector_parsing.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 26321d004..92932a230 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
if (entry == NULL)
return -1;
- memset(entry, 0, strlen(line) + 1);
- strncpy(entry, line, strlen(line));
+ strcpy(entry, line);
/* check if entry ends with , or = */
if (entry[strlen(entry) - 1] == ','
@@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
if (entry_extended == NULL)
goto err;
entry = entry_extended;
-
- strncat(entry, line, strlen(line));
+ /* entry has been allocated accordingly */
+ strcpy(&entry[strlen(entry)], line);
if (entry[strlen(entry) - 1] != ',')
break;
--
2.14.2
More information about the stable
mailing list