From 4325773e7627eb6b6ba4779de264e42512fce538 Mon Sep 17 00:00:00 2001 From: Shreyas Balakrishna Date: Thu, 23 Nov 2017 14:58:45 +1300 Subject: [PATCH] Fix unsigned integer underflow in UnityAssertEqualIntArray --- src/unity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unity.c b/src/unity.c index 177af0f..209efe7 100644 --- a/src/unity.c +++ b/src/unity.c @@ -556,7 +556,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; - while (elements--) + while ((elements > 0) && elements--) { UNITY_INT expect_val; UNITY_INT actual_val; -- GitLab