[PATCH v3 1/3] app/crypto-perf: fix asymmetric op pool name size

Bruce Richardson bruce.richardson at intel.com
Mon Oct 19 09:47:57 CEST 2026


On Fri, Oct 16, 2026 at 10:13:53PM +0200, Morten Brørup wrote:
> > @@ -154,7 +154,7 @@ cperf_alloc_common_memory(const struct
> > cperf_options *options,
> > 
> >  	if (cperf_is_asym_test(options)) {
> >  		crypto_op_size += sizeof(struct rte_crypto_asym_op);
> > -		snprintf(pool_name, RTE_MEMPOOL_NAMESIZE,
> > "perf_asym_op_pool%u",
> > +		snprintf(pool_name, sizeof(pool_name),
> > "perf_asym_op_pool%u",
> >  			 rte_socket_id());
> >  		*pool = rte_crypto_op_pool_create(
> >  			pool_name, RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
> 
> snprintf() doesn't ensure zero-terminated string.

Actually it does. If return value is size of more, then truncation has
occurred, and only size-1 bytes plus null have been written.

> Not new, and don't know if it matters; just mentioning it.
> 
> Acked-by: Morten Brørup <mb at smartsharesystems.com>
> 


More information about the dev mailing list