mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
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
This commit is contained in:
parent
c64bdf6aa5
commit
30f100e140
@ -159,7 +159,7 @@ static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
|
||||
|
||||
const char *I1=s1, *I2=s2;
|
||||
|
||||
while (*I1 != '\0' || *I2 != '\0' )
|
||||
while (*I1 != '\0' && *I2 != '\0' )
|
||||
if (tolower(*I1) != tolower(*I2)) { // No match. Start over.
|
||||
++s1; I1 = s1; I2 = s2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user