llvm.org GIT mirror llvm / 30f100e
Fix incorrect testing for the end of the both strings in CStrInCStrNoCase. This could cause a read-out-of-bounds error if s2 is smaller than s1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58009 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 11 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
158158
159159 const char *I1=s1, *I2=s2;
160160
161 while (*I1 != '\0' || *I2 != '\0' )
161 while (*I1 != '\0' && *I2 != '\0' )
162162 if (tolower(*I1) != tolower(*I2)) { // No match. Start over.
163163 ++s1; I1 = s1; I2 = s2;
164164 }