DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] common/qat: replace snprintf
@ 2018-07-02 17:25 Fiona Trahe
  2018-07-05 10:47 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Trahe @ 2018-07-02 17:25 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, fiona.trahe, tomaszx.jozwiak

Replaced snprintf with strlcpy for safer string copy

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/common/qat/qat_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index 64f236e..f32d723 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -2,6 +2,8 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <rte_string_fns.h>
+
 #include "qat_device.h"
 #include "adf_transport_access_macros.h"
 #include "qat_sym_pmd.h"
@@ -116,7 +118,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)
 
 	qat_dev = qat_pci_get_dev(qat_dev_id);
 	memset(qat_dev, 0, sizeof(*qat_dev));
-	snprintf(qat_dev->name, QAT_DEV_NAME_MAX_LEN, "%s", name);
+	strlcpy(qat_dev->name, name, QAT_DEV_NAME_MAX_LEN);
 	qat_dev->qat_dev_id = qat_dev_id;
 	qat_dev->pci_dev = pci_dev;
 	switch (qat_dev->pci_dev->id.device_id) {
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] common/qat: replace snprintf
  2018-07-02 17:25 [dpdk-dev] [PATCH] common/qat: replace snprintf Fiona Trahe
@ 2018-07-05 10:47 ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 2+ messages in thread
From: De Lara Guarch, Pablo @ 2018-07-05 10:47 UTC (permalink / raw)
  To: Trahe, Fiona, dev; +Cc: Jozwiak, TomaszX



> -----Original Message-----
> From: Trahe, Fiona
> Sent: Monday, July 2, 2018 6:26 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Jozwiak, TomaszX <tomaszx.jozwiak@intel.com>
> Subject: [PATCH] common/qat: replace snprintf
> 
> Replaced snprintf with strlcpy for safer string copy
> 
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

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

end of thread, other threads:[~2018-07-05 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 17:25 [dpdk-dev] [PATCH] common/qat: replace snprintf Fiona Trahe
2018-07-05 10:47 ` De Lara Guarch, Pablo

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).