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
5e3d8623
Kaydet (Commit)
5e3d8623
authored
Ock 09, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1400115, Fix segfault when calling curses.panel.userptr()
without prior setting of the userptr. Will backport.
üst
e0aec6df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
test_curses.py
Lib/test/test_curses.py
+11
-0
NEWS
Misc/NEWS
+3
-0
_curses_panel.c
Modules/_curses_panel.c
+5
-0
No files found.
Lib/test/test_curses.py
Dosyayı görüntüle @
5e3d8623
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#
#
import
curses
,
sys
,
tempfile
,
os
import
curses
,
sys
,
tempfile
,
os
import
curses.panel
# Optionally test curses module. This currently requires that the
# Optionally test curses module. This currently requires that the
# 'curses' resource be given on the regrtest command line using the -u
# 'curses' resource be given on the regrtest command line using the -u
...
@@ -213,12 +214,22 @@ def unit_tests():
...
@@ -213,12 +214,22 @@ def unit_tests():
print
'curses.unctrl fails on character'
,
repr
(
ch
)
print
'curses.unctrl fails on character'
,
repr
(
ch
)
def
test_userptr_without_set
(
stdscr
):
w
=
curses
.
newwin
(
10
,
10
)
p
=
curses
.
panel
.
new_panel
(
w
)
# try to access userptr() before calling set_userptr() -- segfaults
try
:
p
.
userptr
()
raise
RuntimeError
,
'userptr should fail since not set'
except
curses
.
panel
.
error
:
pass
def
main
(
stdscr
):
def
main
(
stdscr
):
curses
.
savetty
()
curses
.
savetty
()
try
:
try
:
module_funcs
(
stdscr
)
module_funcs
(
stdscr
)
window_funcs
(
stdscr
)
window_funcs
(
stdscr
)
test_userptr_without_set
(
stdscr
)
finally
:
finally
:
curses
.
resetty
()
curses
.
resetty
()
...
...
Misc/NEWS
Dosyayı görüntüle @
5e3d8623
...
@@ -209,6 +209,9 @@ Core and builtins
...
@@ -209,6 +209,9 @@ Core and builtins
Extension
Modules
Extension
Modules
-----------------
-----------------
-
Bug
#
1400115
,
Fix
segfault
when
calling
curses
.
panel
.
userptr
()
without
prior
setting
of
the
userptr
.
-
Fix
64
-
bit
problems
in
bsddb
.
-
Fix
64
-
bit
problems
in
bsddb
.
-
Patch
#
1365916
:
fix
some
unsafe
64
-
bit
mmap
methods
.
-
Patch
#
1365916
:
fix
some
unsafe
64
-
bit
mmap
methods
.
...
...
Modules/_curses_panel.c
Dosyayı görüntüle @
5e3d8623
...
@@ -299,6 +299,11 @@ PyCursesPanel_userptr(PyCursesPanelObject *self)
...
@@ -299,6 +299,11 @@ PyCursesPanel_userptr(PyCursesPanelObject *self)
PyObject
*
obj
;
PyObject
*
obj
;
PyCursesInitialised
;
PyCursesInitialised
;
obj
=
(
PyObject
*
)
panel_userptr
(
self
->
pan
);
obj
=
(
PyObject
*
)
panel_userptr
(
self
->
pan
);
if
(
obj
==
NULL
)
{
PyErr_SetString
(
PyCursesError
,
"no userptr set"
);
return
NULL
;
}
Py_INCREF
(
obj
);
Py_INCREF
(
obj
);
return
obj
;
return
obj
;
}
}
...
...
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