Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4f469c09
Unverified
Kaydet (Commit)
4f469c09
authored
Kas 01, 2017
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Kas 01, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220)
üst
7e68790f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
13 deletions
+37
-13
test_curses.py
Lib/test/test_curses.py
+8
-1
2017-11-01-18-13-42.bpo-27666.j2zRnF.rst
...S.d/next/Library/2017-11-01-18-13-42.bpo-27666.j2zRnF.rst
+3
-0
_cursesmodule.c
Modules/_cursesmodule.c
+26
-12
No files found.
Lib/test/test_curses.py
Dosyayı görüntüle @
4f469c09
...
@@ -92,7 +92,7 @@ class TestCurses(unittest.TestCase):
...
@@ -92,7 +92,7 @@ class TestCurses(unittest.TestCase):
with
self
.
subTest
(
meth
=
meth
.
__qualname__
,
args
=
args
):
with
self
.
subTest
(
meth
=
meth
.
__qualname__
,
args
=
args
):
meth
(
*
args
)
meth
(
*
args
)
for
meth
in
[
stdscr
.
box
,
stdscr
.
clear
,
stdscr
.
clrtobot
,
for
meth
in
[
stdscr
.
clear
,
stdscr
.
clrtobot
,
stdscr
.
clrtoeol
,
stdscr
.
cursyncup
,
stdscr
.
delch
,
stdscr
.
clrtoeol
,
stdscr
.
cursyncup
,
stdscr
.
delch
,
stdscr
.
deleteln
,
stdscr
.
erase
,
stdscr
.
getbegyx
,
stdscr
.
deleteln
,
stdscr
.
erase
,
stdscr
.
getbegyx
,
stdscr
.
getbkgd
,
stdscr
.
getkey
,
stdscr
.
getmaxyx
,
stdscr
.
getbkgd
,
stdscr
.
getkey
,
stdscr
.
getmaxyx
,
...
@@ -126,6 +126,13 @@ class TestCurses(unittest.TestCase):
...
@@ -126,6 +126,13 @@ class TestCurses(unittest.TestCase):
win
.
border
(
65
,
66
,
67
,
68
,
win
.
border
(
65
,
66
,
67
,
68
,
69
,
[],
71
,
72
)
69
,
[],
71
,
72
)
win
.
box
(
65
,
67
)
win
.
box
(
'!'
,
'_'
)
win
.
box
(
b
':'
,
b
'~'
)
self
.
assertRaises
(
TypeError
,
win
.
box
,
65
,
66
,
67
)
self
.
assertRaises
(
TypeError
,
win
.
box
,
65
)
win
.
box
()
stdscr
.
clearok
(
1
)
stdscr
.
clearok
(
1
)
win4
=
stdscr
.
derwin
(
2
,
2
)
win4
=
stdscr
.
derwin
(
2
,
2
)
...
...
Misc/NEWS.d/next/Library/2017-11-01-18-13-42.bpo-27666.j2zRnF.rst
0 → 100644
Dosyayı görüntüle @
4f469c09
Fixed stack corruption in curses.box() and curses.ungetmouse() when the size
of types chtype or mmask_t is less than the size of C long. curses.box()
now accepts characters as arguments. Based on patch by Steve Fink.
Modules/_cursesmodule.c
Dosyayı görüntüle @
4f469c09
...
@@ -911,12 +911,19 @@ PyCursesWindow_Border(PyCursesWindowObject *self, PyObject *args)
...
@@ -911,12 +911,19 @@ PyCursesWindow_Border(PyCursesWindowObject *self, PyObject *args)
static
PyObject
*
static
PyObject
*
PyCursesWindow_Box
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindow_Box
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
{
{
PyObject
*
temp1
,
*
temp2
;
chtype
ch1
=
0
,
ch2
=
0
;
chtype
ch1
=
0
,
ch2
=
0
;
switch
(
PyTuple_Size
(
args
)){
switch
(
PyTuple_Size
(
args
)){
case
0
:
break
;
case
0
:
break
;
default
:
default
:
if
(
!
PyArg_ParseTuple
(
args
,
"
ll;vertint,horint"
,
&
ch1
,
&
ch
2
))
if
(
!
PyArg_ParseTuple
(
args
,
"
OO;verch,horch"
,
&
temp1
,
&
temp
2
))
return
NULL
;
return
NULL
;
if
(
!
PyCurses_ConvertToChtype
(
self
,
temp1
,
&
ch1
))
{
return
NULL
;
}
if
(
!
PyCurses_ConvertToChtype
(
self
,
temp2
,
&
ch2
))
{
return
NULL
;
}
}
}
box
(
self
->
win
,
ch1
,
ch2
);
box
(
self
->
win
,
ch1
,
ch2
);
Py_RETURN_NONE
;
Py_RETURN_NONE
;
...
@@ -2268,24 +2275,30 @@ PyCurses_GetMouse(PyObject *self)
...
@@ -2268,24 +2275,30 @@ PyCurses_GetMouse(PyObject *self)
PyErr_SetString
(
PyCursesError
,
"getmouse() returned ERR"
);
PyErr_SetString
(
PyCursesError
,
"getmouse() returned ERR"
);
return
NULL
;
return
NULL
;
}
}
return
Py_BuildValue
(
"(hiii
l
)"
,
return
Py_BuildValue
(
"(hiii
k
)"
,
(
short
)
event
.
id
,
(
short
)
event
.
id
,
event
.
x
,
event
.
y
,
event
.
z
,
(
int
)
event
.
x
,
(
int
)
event
.
y
,
(
int
)
event
.
z
,
(
long
)
event
.
bstate
);
(
unsigned
long
)
event
.
bstate
);
}
}
static
PyObject
*
static
PyObject
*
PyCurses_UngetMouse
(
PyObject
*
self
,
PyObject
*
args
)
PyCurses_UngetMouse
(
PyObject
*
self
,
PyObject
*
args
)
{
{
MEVENT
event
;
MEVENT
event
;
short
id
;
int
x
,
y
,
z
;
unsigned
long
bstate
;
PyCursesInitialised
;
PyCursesInitialised
;
if
(
!
PyArg_ParseTuple
(
args
,
"hiiil"
,
if
(
!
PyArg_ParseTuple
(
args
,
"hiiik"
,
&
event
.
id
,
&
id
,
&
x
,
&
y
,
&
z
,
&
bstate
))
&
event
.
x
,
&
event
.
y
,
&
event
.
z
,
(
int
*
)
&
event
.
bstate
))
return
NULL
;
return
NULL
;
event
.
id
=
id
;
event
.
x
=
x
;
event
.
y
=
y
;
event
.
z
=
z
;
event
.
bstate
=
bstate
;
return
PyCursesCheckERR
(
ungetmouse
(
&
event
),
"ungetmouse"
);
return
PyCursesCheckERR
(
ungetmouse
(
&
event
),
"ungetmouse"
);
}
}
#endif
#endif
...
@@ -2669,14 +2682,15 @@ PyCurses_MouseInterval(PyObject *self, PyObject *args)
...
@@ -2669,14 +2682,15 @@ PyCurses_MouseInterval(PyObject *self, PyObject *args)
static
PyObject
*
static
PyObject
*
PyCurses_MouseMask
(
PyObject
*
self
,
PyObject
*
args
)
PyCurses_MouseMask
(
PyObject
*
self
,
PyObject
*
args
)
{
{
int
newmask
;
unsigned
long
newmask
;
mmask_t
oldmask
,
availmask
;
mmask_t
oldmask
,
availmask
;
PyCursesInitialised
;
PyCursesInitialised
;
if
(
!
PyArg_ParseTuple
(
args
,
"
i
;mousemask"
,
&
newmask
))
if
(
!
PyArg_ParseTuple
(
args
,
"
k
;mousemask"
,
&
newmask
))
return
NULL
;
return
NULL
;
availmask
=
mousemask
(
newmask
,
&
oldmask
);
availmask
=
mousemask
((
mmask_t
)
newmask
,
&
oldmask
);
return
Py_BuildValue
(
"(ll)"
,
(
long
)
availmask
,
(
long
)
oldmask
);
return
Py_BuildValue
(
"(kk)"
,
(
unsigned
long
)
availmask
,
(
unsigned
long
)
oldmask
);
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment