sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.
Fixes:
473d1bebce ("hash: allow to store data in hash table")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
if (with_data)
/* Table will store 8-byte data */
- sprintf(name, "test_hash%d_data", hashtest_key_lens[table_index]);
+ snprintf(name, sizeof(name), "test_hash%u_data",
+ hashtest_key_lens[table_index]);
else
- sprintf(name, "test_hash%d", hashtest_key_lens[table_index]);
+ snprintf(name, sizeof(name), "test_hash%u",
+ hashtest_key_lens[table_index]);
if (with_locks)