Commit 3c9d177
The X/Open curses specification[0] and ncurses documentation[1]
both state that subwindows must be deleted before the main window.
Deleting the windows in the wrong order causes a double-free with
NetBSD's curses implementation.
To fix this, keep track of the original window object in the subwindow
object, and keep a reference to the original for the lifetime of
the subwindow.
[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
[1] https://invisible-island.net/ncurses/man/curs_window.3x.html
(cherry picked from commit 0af61fe)
Co-authored-by: Michael Forney <[email protected]>
1 parent e090f8e commit 3c9d177
File tree
4 files changed
+26
-10
lines changed- Include
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
4 files changed
+26
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
| 670 | + | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
| |||
697 | 698 | | |
698 | 699 | | |
699 | 700 | | |
| 701 | + | |
| 702 | + | |
700 | 703 | | |
701 | 704 | | |
702 | 705 | | |
| |||
706 | 709 | | |
707 | 710 | | |
708 | 711 | | |
| 712 | + | |
709 | 713 | | |
710 | 714 | | |
711 | 715 | | |
| |||
1309 | 1313 | | |
1310 | 1314 | | |
1311 | 1315 | | |
1312 | | - | |
| 1316 | + | |
1313 | 1317 | | |
1314 | 1318 | | |
1315 | 1319 | | |
| |||
2336 | 2340 | | |
2337 | 2341 | | |
2338 | 2342 | | |
2339 | | - | |
| 2343 | + | |
2340 | 2344 | | |
2341 | 2345 | | |
2342 | 2346 | | |
| |||
3084 | 3088 | | |
3085 | 3089 | | |
3086 | 3090 | | |
3087 | | - | |
| 3091 | + | |
3088 | 3092 | | |
3089 | 3093 | | |
3090 | 3094 | | |
| |||
3257 | 3261 | | |
3258 | 3262 | | |
3259 | 3263 | | |
3260 | | - | |
| 3264 | + | |
3261 | 3265 | | |
3262 | 3266 | | |
3263 | 3267 | | |
| |||
3349 | 3353 | | |
3350 | 3354 | | |
3351 | 3355 | | |
3352 | | - | |
| 3356 | + | |
3353 | 3357 | | |
3354 | 3358 | | |
3355 | 3359 | | |
| |||
3728 | 3732 | | |
3729 | 3733 | | |
3730 | 3734 | | |
3731 | | - | |
| 3735 | + | |
3732 | 3736 | | |
3733 | 3737 | | |
3734 | 3738 | | |
| |||
3767 | 3771 | | |
3768 | 3772 | | |
3769 | 3773 | | |
3770 | | - | |
| 3774 | + | |
3771 | 3775 | | |
3772 | 3776 | | |
3773 | 3777 | | |
| |||
0 commit comments