git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92c210f
)
common/qat: replace snprintf
author
Fiona Trahe
<fiona.trahe@intel.com>
Mon, 2 Jul 2018 17:25:34 +0000
(18:25 +0100)
committer
Pablo de Lara
<pablo.de.lara.guarch@intel.com>
Tue, 10 Jul 2018 22:57:51 +0000
(
00:57
+0200)
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
patch
|
blob
|
history
diff --git
a/drivers/common/qat/qat_device.c
b/drivers/common/qat/qat_device.c
index
64f236e
..
f32d723
100644
(file)
--- 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));
- s
nprintf(qat_dev->name, QAT_DEV_NAME_MAX_LEN, "%s", name
);
+ s
trlcpy(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) {