summaryrefslogtreecommitdiff
path: root/modules/mono/glue
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2020-02-08 12:07:41 +0100
committerRaul Santos <raulsntos@gmail.com>2020-02-08 12:07:41 +0100
commit4b79ef5ebe2faa4b3690d90dc36ab6ead5ff1315 (patch)
tree7249a883cc78ad1fd2d9b43efcb69be2fa12eb8f /modules/mono/glue
parent343b29a651429eb57bf5acf95a14e2ff1773ab88 (diff)
Avoid going out of bounds in IsSubsequenceOf
Closes #35598
Diffstat (limited to 'modules/mono/glue')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
index b926037e5a..e096d37a6f 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
@@ -474,7 +474,7 @@ namespace Godot
int source = 0;
int target = 0;
- while (instance[source] != 0 && text[target] != 0)
+ while (source < len && target < text.Length)
{
bool match;
@@ -491,7 +491,7 @@ namespace Godot
if (match)
{
source++;
- if (instance[source] == 0)
+ if (source >= len)
return true;
}