summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorPallantla Poornima <pallantlax.poornima@intel.com>2019-01-07 10:46:23 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-14 23:27:27 +0100
commita1e8241a919f7239d16e63fbc41549b2c951e1ae (patch)
treef49193442e0dc9e15ff2cadbcb3f753f428db722 /drivers/bus
parent29a62d1476b64e63d87ea711d09be0301ade7060 (diff)
downloaddpdk-next-eventdev-a1e8241a919f7239d16e63fbc41549b2c951e1ae.zip
dpdk-next-eventdev-a1e8241a919f7239d16e63fbc41549b2c951e1ae.tar.gz
dpdk-next-eventdev-a1e8241a919f7239d16e63fbc41549b2c951e1ae.tar.xz
drivers: fix sprintf with snprintf
sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used Fixes: 828d51d8fc ("bus/fslmc: refactor scan and probe functions") Fixes: c22fab9a6c ("raw/dpaa2_qdma: support configuration APIs") Fixes: e5cbdfc537 ("crypto/dpaa2_sec: add basic operations") Fixes: b23d4e898a ("crypto/dpaa2_sec: add per dev mempool to store FLE") Fixes: 623326dded ("crypto/dpaa2_sec: introduce poll mode driver") Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations") Fixes: f44bccadd8 ("crypto/caam_jr: add device basic operations") Fixes: 7e3e2954e0 ("crypto/dpaa_sec: move mempool allocation to config") Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/fslmc/fslmc_bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index fa15053..44c0827 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -297,8 +297,8 @@ rte_fslmc_scan(void)
goto scan_fail;
/* Scan devices on the group */
- sprintf(fslmc_dirpath, "%s/%d/devices", VFIO_IOMMU_GROUP_PATH,
- groupid);
+ snprintf(fslmc_dirpath, sizeof(fslmc_dirpath), "%s/%d/devices",
+ VFIO_IOMMU_GROUP_PATH, groupid);
dir = opendir(fslmc_dirpath);
if (!dir) {
DPAA2_BUS_ERR("Unable to open VFIO group directory");