summaryrefslogtreecommitdiff
path: root/drivers/common
diff options
context:
space:
mode:
authorFiona Trahe <fiona.trahe@intel.com>2018-07-02 18:25:34 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2018-07-11 00:57:51 +0200
commit90f5eede124c6ffbe53095d573140ff0c5921213 (patch)
tree1311d65a9a0192ecbda9caff8e1986ff6301e8b8 /drivers/common
parent92c210f0b4882bcf3f04402490b3ed74bbb624a2 (diff)
downloaddpdk-next-eventdev-90f5eede124c6ffbe53095d573140ff0c5921213.zip
dpdk-next-eventdev-90f5eede124c6ffbe53095d573140ff0c5921213.tar.gz
dpdk-next-eventdev-90f5eede124c6ffbe53095d573140ff0c5921213.tar.xz
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>
Diffstat (limited to 'drivers/common')
-rw-r--r--drivers/common/qat/qat_device.c4
1 files changed, 3 insertions, 1 deletions
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) {