qulogic/libgnt
Clone
Summary
Browse
Changes
Graph
gnt: Fix use-after-free memory violation during Python initialization
2018-05-25, kdex
53d9e9edc8ac
gnt: Fix use-after-free memory violation during Python initialization
Turns out there never was a reason to allocate a wide-character string on the heap to begin with; C has wide-character string literals.
#include
<ncurses.h>
int
main
()
{
int
ch
;
initscr
();
noecho
();
cbreak
();
refresh
();
WINDOW
*
win
=
newpad
(
20
,
30
);
box
(
win
,
0
,
0
);
prefresh
(
win
,
0
,
0
,
0
,
0
,
19
,
29
);
doupdate
();
while
((
ch
=
getch
()))
{
printw
(
"%d "
,
ch
);
refresh
();
}
endwin
();
return
0
;
}