Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e5a404ea
Commit
e5a404ea
authored
Jan 09, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1400115, Fix segfault when calling curses.panel.userptr()
without prior setting of the userptr. Will backport.
parent
7c8af60b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
Lib/test/test_curses.py
Lib/test/test_curses.py
+11
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_curses_panel.c
Modules/_curses_panel.c
+5
-0
No files found.
Lib/test/test_curses.py
View file @
e5a404ea
...
...
@@ -9,6 +9,7 @@
#
import
curses
,
sys
,
tempfile
,
os
import
curses.panel
# Optionally test curses module. This currently requires that the
# 'curses' resource be given on the regrtest command line using the -u
...
...
@@ -213,12 +214,22 @@ def unit_tests():
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
):
curses
.
savetty
()
try
:
module_funcs
(
stdscr
)
window_funcs
(
stdscr
)
test_userptr_without_set
(
stdscr
)
finally
:
curses
.
resetty
()
...
...
Misc/NEWS
View file @
e5a404ea
...
...
@@ -209,6 +209,9 @@ Core and builtins
Extension
Modules
-----------------
-
Bug
#
1400115
,
Fix
segfault
when
calling
curses
.
panel
.
userptr
()
without
prior
setting
of
the
userptr
.
-
Fix
64
-
bit
problems
in
bsddb
.
-
Patch
#
1365916
:
fix
some
unsafe
64
-
bit
mmap
methods
.
...
...
Modules/_curses_panel.c
View file @
e5a404ea
...
...
@@ -299,6 +299,11 @@ PyCursesPanel_userptr(PyCursesPanelObject *self)
PyObject
*
obj
;
PyCursesInitialised
;
obj
=
(
PyObject
*
)
panel_userptr
(
self
->
pan
);
if
(
obj
==
NULL
)
{
PyErr_SetString
(
PyCursesError
,
"no userptr set"
);
return
NULL
;
}
Py_INCREF
(
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