event/octeontx: fix snprintf mempool name overflow
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Mon, 23 Apr 2018 13:39:33 +0000 (19:09 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 25 Apr 2018 14:49:17 +0000 (16:49 +0200)
Bugzilla-ID: 28
Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")

Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
drivers/event/octeontx/timvf_evdev.c

index b20a2f1..b461209 100644 (file)
@@ -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);