mirror of
https://github.com/godotengine/godot.git
synced 2024-12-16 16:13:56 +00:00
Avoid going out of bounds in IsSubsequenceOf
Closes #35598
(cherry picked from commit 4b79ef5ebe
)
This commit is contained in:
parent
be34e45233
commit
0fb35401d4
@ -475,7 +475,7 @@ namespace Godot
|
||||
int source = 0;
|
||||
int target = 0;
|
||||
|
||||
while (instance[source] != 0 && text[target] != 0)
|
||||
while (source < len && target < text.Length)
|
||||
{
|
||||
bool match;
|
||||
|
||||
@ -492,7 +492,7 @@ namespace Godot
|
||||
if (match)
|
||||
{
|
||||
source++;
|
||||
if (instance[source] == 0)
|
||||
if (source >= len)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user