patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] crypto/scheduler: fix build with gcc 8.2
@ 2018-11-03 14:58 Jerin Jacob
  2018-11-04 21:01 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Jerin Jacob @ 2018-11-03 14:58 UTC (permalink / raw)
  To: dev, Fan Zhang; +Cc: thomas, ferruh.yigit, Jacob,  Jerin, stable

build_error:

drivers/crypto/scheduler/scheduler_pmd.c: In function ‘parse_name_arg’:
drivers/crypto/scheduler/scheduler_pmd.c:372:2: error: ‘strncpy’
specified bound 64 equals destination size [-Werror=stringop-truncation]
  strncpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strncpy may result a not null-terminated string,
replaced it with strlcpy

Fixes: 503e9c5afb38 ("crypto/scheduler: register as vdev driver")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 20198ccb0..a1632a2b9 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -369,7 +369,7 @@ parse_name_arg(const char *key __rte_unused,
 		return -EINVAL;
 	}
 
-	strncpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
+	strlcpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
 
 	return 0;
 }
-- 
2.19.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] crypto/scheduler: fix build with gcc 8.2
  2018-11-03 14:58 [dpdk-stable] [dpdk-dev] [PATCH] crypto/scheduler: fix build with gcc 8.2 Jerin Jacob
@ 2018-11-04 21:01 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2018-11-04 21:01 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, Fan Zhang, ferruh.yigit, Jacob, Jerin, stable

03/11/2018 15:58, Jerin Jacob:
> build_error:
> 
> drivers/crypto/scheduler/scheduler_pmd.c: In function ‘parse_name_arg’:
> drivers/crypto/scheduler/scheduler_pmd.c:372:2: error: ‘strncpy’
> specified bound 64 equals destination size [-Werror=stringop-truncation]
>   strncpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> strncpy may result a not null-terminated string,
> replaced it with strlcpy
> 
> Fixes: 503e9c5afb38 ("crypto/scheduler: register as vdev driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-04 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-03 14:58 [dpdk-stable] [dpdk-dev] [PATCH] crypto/scheduler: fix build with gcc 8.2 Jerin Jacob
2018-11-04 21:01 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).