Skip to contentSkip to conversation

example/ip_pipeline: fix copy into fixed size buffer defect

PATCH Applied Fan Zhang 2 participants 2 messages Dec 11, 2015 – Dec 13, 2015

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

PATCH v2 1/1 example/ip_pipeline: fix copy into fixed size buffer defect

Coverity issue: 107133

Fixes eb32fe7c5574 ("examples/ip_pipeline: rework initialization parameters")

---
*v2
fixed bug: fix possible buff not null terminated bug

 examples/ip_pipeline/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ip_pipeline/init.c +1 -1
index bc6d6d9..186ca03 100644
@@ -1068,7 +1068,7 @@ static void app_pipeline_params_get(struct app_params *app,
 	uint32_t i;
 	uint32_t mempool_id;
 
-	strcpy(p_out->name, p_in->name);
+	snprintf(p_out->name, PIPELINE_NAME_SIZE, "%s", p_in->name);
 
 	p_out->socket_id = (int) p_in->socket_id;
 
Signature · 1 line
2.5.0