llvm.org GIT mirror llvm / 07b9e8f
Merge from mainline 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/branches/release_24@58031 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
155155
156156 const char *I1=s1, *I2=s2;
157157
158 while (*I1 != '\0' || *I2 != '\0' )
158 while (*I1 != '\0' && *I2 != '\0' )
159159 if (tolower(*I1) != tolower(*I2)) { // No match. Start over.
160160 ++s1; I1 = s1; I2 = s2;
161161 }