diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-09 00:02:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 00:02:30 +0100 |
commit | 9cc4f5e3aeee77fd8bc37063c3071e5de418638d (patch) | |
tree | f6df4100671ad1f5fb5093100839975007fab6a3 | |
parent | fd71f3c888321b227fe2f3c9f4f48411b9d78ac5 (diff) | |
parent | 4b79ef5ebe2faa4b3690d90dc36ab6ead5ff1315 (diff) |
Merge pull request #36013 from raulsntos/fix-issubsequenceof
Avoid going out of bounds in IsSubsequenceOf
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs | 4 |
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; } |