dotnet / dotnet/wpf

WPF apps crash if they display text with too many combining marks

Open
#244 5 comments 3 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 3.0.100-preview-010024
* Windows version: (`winver`) win 10
* Does the bug reproduce also in WPF for .NET Framework 4.8?: yes

**Problem description:**

If there are too many combining marks or other special chars on one line and you try to show this text in a WPF textbox or WPF text editor, the application crashes.

**Actual behavior:**

Crash

**Expected behavior:**

The extra special chars are either ignored or a .NET exception is thrown.

**Minimal repro:**

Paste this text in a WPF textbox or a WPF text editor (it's `new string ('\u0483', 550)`)

```
҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃
```

Here's code that generates it, don't try to display it in the VS C# REPL, it will crash VS:

```C#
File.WriteAllLines(@"c:\some\dir\a.txt", new[] {new string ('\u0483', 550) })
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.