[dpdk-dev] [PATCH v4 18/18] app/test-bbdev: strcpy ok for allocated string

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri May 11 15:02:27 CEST 2018



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Andy Green
> Sent: Friday, May 11, 2018 2:47 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v4 18/18] app/test-bbdev: strcpy ok for allocated
> string
> 
> Signed-off-by: Andy Green <andy at warmcat.com>
> ---
>  app/test-bbdev/test_bbdev_vector.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-
> bbdev/test_bbdev_vector.c
> index c574f2135..4a3ddcffe 100644
> --- a/app/test-bbdev/test_bbdev_vector.c
> +++ b/app/test-bbdev/test_bbdev_vector.c
> @@ -914,7 +914,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 memset is removed in the previous patch, then we'll need to use strlcpy
here, to ensure NULL termination.

Missing fixes line and CC stable:

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Cc: stable at dpdk.org



More information about the dev mailing list