Commit b87e630
committed
gh-154749: Reject a terminal-less screen in curses.set_term()
curses.set_term() accepted a screen returned by new_prescr(), which has no
terminal attached. Making such a screen current left curses without a
terminal, and the next window refresh dereferenced NULL and crashed the
interpreter.
set_term() now raises curses.error for a screen with no standard window,
which is exactly a new_prescr() screen. The documentation already said the
argument comes from newterm().1 parent 5afbb60 commit b87e630
4 files changed
Lines changed: 24 additions & 1 deletion
File tree
- Doc/library
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3072 | 3072 | | |
3073 | 3073 | | |
3074 | 3074 | | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3075 | 3087 | | |
3076 | 3088 | | |
3077 | 3089 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6834 | 6834 | | |
6835 | 6835 | | |
6836 | 6836 | | |
| 6837 | + | |
| 6838 | + | |
| 6839 | + | |
| 6840 | + | |
| 6841 | + | |
| 6842 | + | |
| 6843 | + | |
6837 | 6844 | | |
6838 | 6845 | | |
6839 | 6846 | | |
6840 | 6847 | | |
6841 | | - | |
6842 | 6848 | | |
6843 | 6849 | | |
6844 | 6850 | | |
| |||
0 commit comments