From: Sergio Gonzalez Monroy Date: Tue, 17 Nov 2015 15:39:16 +0000 (+0000) Subject: app/test: fix integer overflow in memory unit test X-Git-Tag: spdx-start~7848 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5db083773f4d81e99541ad55b8946f3df2c512f3;p=dpdk.git app/test: fix integer overflow in memory unit test 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 Acked-by: Pablo de Lara --- diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 02ef3cfac0..6816385ba7 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; /*