From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergio Gonzalez Monroy Subject: [PATCH] app/test: fix memory_autotest integer overflow/wraparound Date: Tue, 17 Nov 2015 15:39:16 +0000 Message-ID: <1447774756-107404-1-git-send-email-sergio.gonzalez.monroy@intel.com> To: dev@dpdk.org 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) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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