From 13573bd3f431934da373b1332ef92f8c30940272 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Mon, 23 Apr 2018 19:09:33 +0530 Subject: [PATCH] event/octeontx: fix snprintf mempool name overflow Bugzilla-ID: 28 Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter") Reported-by: Harry van Haaren Signed-off-by: Pavan Nikhilesh Tested-by: Harry van Haaren --- drivers/event/octeontx/timvf_evdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index b20a2f1f5a..b461209c2b 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -295,7 +295,8 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) if (timr->bkt == NULL) goto mem_err; - snprintf(pool_name, 30, "timvf_chunk_pool%d", timr->tim_ring_id); + snprintf(pool_name, sizeof(pool_name), "timvf_chunk_pool%d", + timr->tim_ring_id); timr->chunk_pool = (void *)rte_mempool_create_empty(pool_name, timr->nb_chunks, TIM_CHUNK_SIZE, 0, 0, rte_socket_id(), mp_flags); -- 2.20.1