From: Fiona Trahe Date: Mon, 2 Jul 2018 17:25:34 +0000 (+0100) Subject: common/qat: replace snprintf X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=90f5eede124c6ffbe53095d573140ff0c5921213;p=dpdk.git common/qat: replace snprintf Replaced snprintf with strlcpy for safer string copy Signed-off-by: Fiona Trahe Signed-off-by: Tomasz Jozwiak --- diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index 64f236e1c8..f32d723588 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 + #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) {