From 2dc44ac1a6ea4578f641bbc9a633b4a4e4750cbb Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Wed, 23 Jul 2025 19:52:42 -0500 Subject: [PATCH 1/2] Fix infinite loop on rich text box tag parsing with incomplete end of tag. --- Source/Engine/Utilities/HtmlParser.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/Utilities/HtmlParser.cs b/Source/Engine/Utilities/HtmlParser.cs index 37b614b80..74f252c77 100644 --- a/Source/Engine/Utilities/HtmlParser.cs +++ b/Source/Engine/Utilities/HtmlParser.cs @@ -204,6 +204,10 @@ namespace FlaxEngine.Utilities SkipWhitespace(); while (Peek() != '>') { + // Return false if start of new html tag is detected. + if (Peek() == '<') + return false; + if (Peek() == '/') { // Handle trailing forward slash From 753035c4520bcd0ba10b12002d24e0bc0b93e0b3 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 24 Jul 2025 18:04:39 -0500 Subject: [PATCH 2/2] Fix issue with infinite loop if `\` is used instead of `/` for tag closing. --- Source/Engine/Utilities/HtmlParser.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/Utilities/HtmlParser.cs b/Source/Engine/Utilities/HtmlParser.cs index 74f252c77..708829ba3 100644 --- a/Source/Engine/Utilities/HtmlParser.cs +++ b/Source/Engine/Utilities/HtmlParser.cs @@ -134,6 +134,10 @@ namespace FlaxEngine.Utilities if (isLeadingSlash) Move(); + // Dont process if wrong slash is used. + if (c =='\\') + return false; + // Parse tag bool result = ParseTag(ref tag, name);