[dpdk-stable] patch 'app/bbdev: use strcpy for allocated string' has been queued to stable release 18.02.2
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue May 15 15:53:34 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/16/18. So please
shout if anyone has objections.
Thanks.
Luca Boccassi
---
>From ac04624478cb9bbb1e7a9c659f9b22fae74a73e2 Mon Sep 17 00:00:00 2001
From: Andy Green <andy at warmcat.com>
Date: Mon, 14 May 2018 13:01:07 +0800
Subject: [PATCH] app/bbdev: use strcpy for allocated string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit f2790f9cf8486b01576c6ddfd60d2ce434a2b3e4 ]
app/test-bbdev/test_bbdev_vector.c:895: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-bbdev/test_bbdev_vector.c:917: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));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Signed-off-by: Andy Green <andy at warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
app/test-bbdev/test_bbdev_vector.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index addef0572..5b694dd90 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -889,8 +889,7 @@ test_bbdev_vector_read(const char *filename,
goto exit;
}
- 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] == ','
@@ -912,7 +911,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;
--
2.14.2
More information about the stable
mailing list