[dpdk-stable] [dpdk-dev] [PATCH] app/testbbdev: fix sprintf with snprintf
Ferruh Yigit
ferruh.yigit at intel.com
Fri Feb 8 15:13:59 CET 2019
On 2/4/2019 7:15 AM, Pallantla Poornima wrote:
> @@ -825,7 +825,7 @@
>
> test_bbdev_driver_init(void)
>
> TEST_ASSERT_FAIL(rte_bbdev_release(NULL),
> "Failed to uninitialize bbdev driver with NULL bbdev");
> - sprintf(name_tmp, "%s", "invalid_name");
> + snprintf(name_tmp, sizeof(name_tmp), "%s", "invalid_name");
> dev2 = rte_bbdev_get_named_dev(name_tmp);
> TEST_ASSERT_FAIL(rte_bbdev_release(dev2),
> "Failed to uninitialize bbdev driver with invalid name");
Can use strlcpy() instead of snprintf() here.
More information about the stable
mailing list