Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibGUI: Prevent crashes/hangs when deleting words backwards
When the user hits <Ctrl-Backspace> where the previous content has the format [Punctuation|Seperator]+ before the cursor, there will be a size_t index underflow in TextDocument::first_word_break_before, which returns an invalid word break position with a huge column index (18446744073709551615, -1 in size_t). The invalid text position later used for executing RemoveTextCommand will cause a crash. The while loop condition in TextDocument::first_word_break_before is not right, the loop will never stop when the target.column() becomes 0 inside.
- Loading branch information