From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3D013568B for ; Wed, 9 Dec 2015 10:36:19 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 09 Dec 2015 01:36:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,402,1444719600"; d="scan'208";a="837468527" Received: from gklab-246-018.igk.intel.com (HELO stargo) ([10.217.246.18]) by orsmga001.jf.intel.com with SMTP; 09 Dec 2015 01:36:16 -0800 Received: by stargo (sSMTP sendmail emulation); Wed, 09 Dec 2015 10:33:53 +0100 From: Piotr Azarewicz To: dev@dpdk.org Date: Wed, 9 Dec 2015 10:33:50 +0100 Message-Id: <1449653630-25704-1-git-send-email-piotrx.t.azarewicz@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449584208-24987-1-git-send-email-piotrx.t.azarewicz@intel.com> References: <1449584208-24987-1-git-send-email-piotrx.t.azarewicz@intel.com> Subject: [dpdk-dev] [PATCH v2 1/1] example/ip_pipeline: fix memcpy issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 09:36:19 -0000 The source and destination 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") Fixes: ea0908c4ab89 ("examples/ip_pipeline: add master pipeline") Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization parameters") Signed-off-by: Piotr Azarewicz --- v2 changes: - add the same fix in two other places examples/ip_pipeline/init.c | 2 +- examples/ip_pipeline/pipeline/pipeline_common_fe.c | 2 +- examples/ip_pipeline/thread_fe.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 52aab53..bc6d6d9 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1472,7 +1472,7 @@ app_pipeline_type_cmd_push(struct app_params *app, /* Push pipeline commands into the application */ memcpy(&app->cmds[app->n_cmds], 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; diff --git a/examples/ip_pipeline/pipeline/pipeline_common_fe.c b/examples/ip_pipeline/pipeline/pipeline_common_fe.c index 87ec164..1e16ad6 100644 --- a/examples/ip_pipeline/pipeline/pipeline_common_fe.c +++ b/examples/ip_pipeline/pipeline/pipeline_common_fe.c @@ -1292,7 +1292,7 @@ app_pipeline_common_cmd_push(struct app_params *app) /* Push pipeline commands into the application */ memcpy(&app->cmds[app->n_cmds], pipeline_common_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; 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(&app->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