projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
622927b
)
Coverity-found bug: don't use temp->next *before* checking it for NULL. Also
author
Thomas Wouters
<thomas@python.org>
Tue, 7 Mar 2006 13:38:14 +0000
(13:38 +0000)
committer
Thomas Wouters
<thomas@python.org>
Tue, 7 Mar 2006 13:38:14 +0000
(13:38 +0000)
return rather than use it again.
Modules/_curses_panel.c
patch
|
blob
|
history
diff --git
a/Modules/_curses_panel.c
b/Modules/_curses_panel.c
index c3f313a33483d4719dec4f67a88cd99c805a63b4..0acf3fdee82d436ee100136601240e22b177a1c0 100644
(file)
--- a/
Modules/_curses_panel.c
+++ b/
Modules/_curses_panel.c
@@
-111,10
+111,12
@@
remove_lop(PyCursesPanelObject *po)
free(temp);
return;
}
- while (temp->next->po != po) {
- if (temp->next == NULL)
+ while (temp->next
== NULL || temp->next
->po != po) {
+ if (temp->next == NULL)
{
PyErr_SetString(PyExc_RuntimeError,
"remove_lop: can't find Panel Object");
+ return;
+ }
temp = temp->next;
}
n = temp->next->next;