Skip to content

Commit a912ee3

Browse files
authored
Merge pull request #223 from jeremyhannon/checkLimitBeforeUsingIndex
check 'i' limit before using it as an array index.
2 parents 3581ebb + 148b497 commit a912ee3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ void UnityAssertEqualStringLen(const char* expected,
10041004
/* if both pointers not null compare the strings */
10051005
if (expected && actual)
10061006
{
1007-
for (i = 0; (expected[i] || actual[i]) && i < length; i++)
1007+
for (i = 0; (i < length) && (expected[i] || actual[i]); i++)
10081008
{
10091009
if (expected[i] != actual[i])
10101010
{

0 commit comments

Comments
 (0)