> > In theory, lcore and queue could be so large that mbuf pool name > could overflow. But that can never happen since lcore and queue > will be in range. Add a check so that static tools know that. > > Signed-off-by: Stephen Hemminger <[email protected]> > --- > examples/ip_reassembly/main.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c > index 17ae76d4ba..25b904dbd4 100644 > --- a/examples/ip_reassembly/main.c > +++ b/examples/ip_reassembly/main.c > @@ -884,6 +884,13 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, > uint32_t queue) > > nb_mbuf = RTE_MAX(nb_mbuf, (uint32_t)NB_MBUF); > > + /* Should never happen but check so that pool name won't be too long. */ > + if (lcore > RTE_MAX_LCORE || queue > RTE_MAX_QUEUES_PER_PORT) { > + RTE_LOG(ERR, IP_RSMBL, "invalid lcore %u or queue %u", > + lcore, queue); > + return -1; > + } > + > snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue); > > rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, > MEMPOOL_CACHE_SIZE, 0, > -- Acked-by: Konstantin Ananyev <[email protected]> > 2.51.0
- [PATCH 0/3] examples: format truncation bugs Stephen Hemminger
- [PATCH 2/3] examples/vdpa: fix format overflow war... Stephen Hemminger
- [PATCH 1/3] examples/server_node_efd: fix format o... Stephen Hemminger
- [PATCH 3/3] examples: re-enable format truncation ... Stephen Hemminger
- [PATCH v2 0/7] fix format-truncation warnings Stephen Hemminger
- [PATCH v2 1/7] examples/server_node_efd: fix f... Stephen Hemminger
- [PATCH v2 2/7] examples/vdpa: fix format overf... Stephen Hemminger
- Re: [PATCH v2 2/7] examples/vdpa: fix form... Bruce Richardson
- [PATCH v2 3/7] examples/ip_reassembly: add che... Stephen Hemminger
- RE: [PATCH v2 3/7] examples/ip_reassembly:... Konstantin Ananyev
- Re: [PATCH v2 3/7] examples/ip_reassembly:... Bruce Richardson
- [PATCH v2 4/7] examples: re-enable format trun... Stephen Hemminger
- Re: [PATCH v2 4/7] examples: re-enable for... Bruce Richardson
- [PATCH v2 5/7] test: refactor file prefix arg ... Stephen Hemminger
- [PATCH v2 7/7] test: re-enable format-truncati... Stephen Hemminger
- Re: [PATCH v2 7/7] test: re-enable format-... Bruce Richardson
- [PATCH v2 6/7] test: increase size of memzone ... Stephen Hemminger
- Re: [PATCH v2 6/7] test: increase size of ... Bruce Richardson
- [PATCH v3 0/4] examples: fix format-truncation war... Stephen Hemminger
- [PATCH v3 1/4] examples/server_node_efd: fix f... Stephen Hemminger

