Commit 1a399e9
Fix use-after-free of the curses screen encoding
The module-global curses_screen_encoding stored a borrowed pointer to the
encoding owned by the window returned by the first initscr() call. That
window can be deallocated while unctrl() and ungetch(), which have no window
of their own, still use the pointer to encode non-ASCII characters.
Keep a private copy of the encoding instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent bfecfcc commit 1a399e9
2 files changed
Lines changed: 39 additions & 3 deletions
File tree
- Misc/NEWS.d/next/Library
- Modules
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| |||
3799 | 3803 | | |
3800 | 3804 | | |
3801 | 3805 | | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
3802 | 3821 | | |
3803 | 3822 | | |
3804 | 3823 | | |
| |||
3820 | 3839 | | |
3821 | 3840 | | |
3822 | 3841 | | |
3823 | | - | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
3824 | 3851 | | |
3825 | 3852 | | |
3826 | 3853 | | |
| |||
3927 | 3954 | | |
3928 | 3955 | | |
3929 | 3956 | | |
3930 | | - | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
3931 | 3961 | | |
3932 | 3962 | | |
3933 | 3963 | | |
| |||
5480 | 5510 | | |
5481 | 5511 | | |
5482 | 5512 | | |
| 5513 | + | |
| 5514 | + | |
5483 | 5515 | | |
5484 | 5516 | | |
5485 | 5517 | | |
| |||
0 commit comments