[dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
> -Original Message- > From: Mcnamara, John > Sent: Tuesday, December 8, 2015 6:00 PM > To: Mcnamara, John ; Azarewicz, PiotrX T > ; dev at dpdk.org > Subject: RE: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy > issue > > > -Original Message- > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mcnamara, John > > Sent: Tuesday, December 8, 2015 2:47 PM > > To: Azarewicz, PiotrX T; dev at dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy > > issue > > > > > -Original Message- > > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Piotr Azarewicz > > > Sent: Tuesday, December 8, 2015 2:17 PM > > > To: dev at dpdk.org > > > Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy > > > issue > > > > > > The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t. > > > So the goal is to copy elements size of cmdline_parse_ctx_t not > > > cmdline_parse_ctx_t*. > > > > > > Coverity issue: 120412 > > > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread > > > binding > > > dynamically") > > > > > > Signed-off-by: Piotr Azarewicz > > > > Acked-by: John McNamara > > Hi Piotr, > > This issue occurs copy and pasted in two other locations as well: > > examples/ip_pipeline/pipeline/pipeline_common_fe.c > 1295: n_cmds * sizeof(cmdline_parse_ctx_t *)); > > examples/ip_pipeline/thread_fe.c > 340:n_cmds * sizeof(cmdline_parse_ctx_t *)); > > examples/ip_pipeline/init.c > 1475: n_cmds * sizeof(cmdline_parse_ctx_t *)); > > Perhaps you could fix those in the same patch. > > Thanks, > > John > > Yes, you are right, thanks. I will send v2. Piotr
[dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
> -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mcnamara, John > Sent: Tuesday, December 8, 2015 2:47 PM > To: Azarewicz, PiotrX T; dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy > issue > > > -Original Message- > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Piotr Azarewicz > > Sent: Tuesday, December 8, 2015 2:17 PM > > To: dev at dpdk.org > > Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy > > issue > > > > The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t. > > So the goal is to copy elements size of cmdline_parse_ctx_t not > > cmdline_parse_ctx_t*. > > > > Coverity issue: 120412 > > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding > > dynamically") > > > > Signed-off-by: Piotr Azarewicz > > Acked-by: John McNamara Hi Piotr, This issue occurs copy and pasted in two other locations as well: examples/ip_pipeline/pipeline/pipeline_common_fe.c 1295: n_cmds * sizeof(cmdline_parse_ctx_t *)); examples/ip_pipeline/thread_fe.c 340:n_cmds * sizeof(cmdline_parse_ctx_t *)); examples/ip_pipeline/init.c 1475: n_cmds * sizeof(cmdline_parse_ctx_t *)); Perhaps you could fix those in the same patch. Thanks, John
[dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t. So the goal is to copy elements size of cmdline_parse_ctx_t not cmdline_parse_ctx_t*. Coverity issue: 120412 Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding dynamically") Signed-off-by: Piotr Azarewicz --- examples/ip_pipeline/thread_fe.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ip_pipeline/thread_fe.c b/examples/ip_pipeline/thread_fe.c index 7a3bbf8..f1df05e 100644 --- a/examples/ip_pipeline/thread_fe.c +++ b/examples/ip_pipeline/thread_fe.c @@ -337,7 +337,7 @@ app_pipeline_thread_cmd_push(struct app_params *app) /* Push thread commands into the application */ memcpy(>cmds[app->n_cmds], thread_cmds, - n_cmds * sizeof(cmdline_parse_ctx_t *)); + n_cmds * sizeof(cmdline_parse_ctx_t)); for (i = 0; i < n_cmds; i++) app->cmds[app->n_cmds + i]->data = app; -- 1.7.9.5
[dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue
> -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Piotr Azarewicz > Sent: Tuesday, December 8, 2015 2:17 PM > To: dev at dpdk.org > Subject: [dpdk-dev] [PATCH v1 1/1] example/ip_pipeline: fix memcpy issue > > The cmds and thread_cmds both are the arrays of cmdline_parse_ctx_t. > So the goal is to copy elements size of cmdline_parse_ctx_t not > cmdline_parse_ctx_t*. > > Coverity issue: 120412 > Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding > dynamically") > > Signed-off-by: Piotr Azarewicz Acked-by: John McNamara