From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BAFB45A6C for ; Thu, 10 Dec 2015 10:50:11 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Dec 2015 01:50:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,407,1444719600"; d="scan'208";a="870740175" Received: from rhorton-mobl.ger.corp.intel.com (HELO localhost.ir.intel.com) ([163.33.228.64]) by fmsmga002.fm.intel.com with ESMTP; 10 Dec 2015 01:50:11 -0800 From: Remy Horton To: dev@dpdk.org Date: Thu, 10 Dec 2015 09:50:07 +0000 Message-Id: <1449741007-1022-3-git-send-email-remy.horton@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1449741007-1022-1-git-send-email-remy.horton@intel.com> References: <1449741007-1022-1-git-send-email-remy.horton@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-keepalive: Fix integer overflow 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: Thu, 10 Dec 2015 09:50:12 -0000 Fix Coverity warning with potential 32-bit integer multiplication overflow where final result is expected to be 64-bit. >>> CID 120144 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application") Signed-off-by: Remy Horton --- examples/l2fwd-keepalive/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 8d7b09e..f4d52f2 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -471,7 +471,7 @@ l2fwd_parse_args(int argc, char **argv) /* timer period */ case 'T': timer_period = l2fwd_parse_timer_period(optarg) - * 1000 * TIMER_MILLISECOND; + * (int64_t)(1000 * TIMER_MILLISECOND); if (timer_period < 0) { printf("invalid timer period\n"); l2fwd_usage(prgname); -- 1.9.3