From: Pavan Nikhilesh Date: Mon, 23 Apr 2018 13:39:33 +0000 (+0530) Subject: event/octeontx: fix snprintf mempool name overflow X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=13573bd3f431934da373b1332ef92f8c30940272;p=dpdk.git 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 --- 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);