Commit 90a186a
committed
bpo-44172: Keep reference to original window in curses subwindow objects
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.html1 parent 4fdcc39 commit 90a186a
3 files changed
Lines changed: 17 additions & 9 deletions
File tree
- Include
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
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 | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
666 | | - | |
| 666 | + | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
| |||
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
| 698 | + | |
| 699 | + | |
697 | 700 | | |
698 | 701 | | |
699 | 702 | | |
| |||
703 | 706 | | |
704 | 707 | | |
705 | 708 | | |
| 709 | + | |
706 | 710 | | |
707 | 711 | | |
708 | 712 | | |
| |||
1304 | 1308 | | |
1305 | 1309 | | |
1306 | 1310 | | |
1307 | | - | |
| 1311 | + | |
1308 | 1312 | | |
1309 | 1313 | | |
1310 | 1314 | | |
| |||
2332 | 2336 | | |
2333 | 2337 | | |
2334 | 2338 | | |
2335 | | - | |
| 2339 | + | |
2336 | 2340 | | |
2337 | 2341 | | |
2338 | 2342 | | |
| |||
3081 | 3085 | | |
3082 | 3086 | | |
3083 | 3087 | | |
3084 | | - | |
| 3088 | + | |
3085 | 3089 | | |
3086 | 3090 | | |
3087 | 3091 | | |
| |||
3254 | 3258 | | |
3255 | 3259 | | |
3256 | 3260 | | |
3257 | | - | |
| 3261 | + | |
3258 | 3262 | | |
3259 | 3263 | | |
3260 | 3264 | | |
| |||
3346 | 3350 | | |
3347 | 3351 | | |
3348 | 3352 | | |
3349 | | - | |
| 3353 | + | |
3350 | 3354 | | |
3351 | 3355 | | |
3352 | 3356 | | |
| |||
3719 | 3723 | | |
3720 | 3724 | | |
3721 | 3725 | | |
3722 | | - | |
| 3726 | + | |
3723 | 3727 | | |
3724 | 3728 | | |
3725 | 3729 | | |
| |||
3758 | 3762 | | |
3759 | 3763 | | |
3760 | 3764 | | |
3761 | | - | |
| 3765 | + | |
3762 | 3766 | | |
3763 | 3767 | | |
3764 | 3768 | | |
| |||
0 commit comments