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 0A3395A6C for ; Tue, 17 Nov 2015 16:39:19 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 17 Nov 2015 07:39:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,308,1444719600"; d="scan'208";a="852815213" Received: from sie-lab-212-209.ir.intel.com (HELO silpixa00377983.ir.intel.com) ([10.237.212.209]) by orsmga002.jf.intel.com with ESMTP; 17 Nov 2015 07:39:17 -0800 From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Tue, 17 Nov 2015 15:39:16 +0000 Message-Id: <1447774756-107404-1-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 2.4.3 Subject: [dpdk-dev] [PATCH] app/test: fix memory_autotest integer overflow/wraparound 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: Tue, 17 Nov 2015 15:39:20 -0000 memory_autotest loops infinitely when at least one the memsegs is bigger than 4GB. The issue is the result of an integer overflow/wraparound of the offset variable. Fix it by using the correct type (size_t). Signed-off-by: Sergio Gonzalez Monroy --- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 02ef3cf..6816385 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -55,7 +55,8 @@ static int test_memory(void) { uint64_t s; - unsigned i, j; + unsigned i; + size_t j; const struct rte_memseg *mem; /* -- 2.4.3