mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Coverity-found bug: don't use temp->next *before* checking it for NULL. Also
return rather than use it again.
This commit is contained in:
parent
622927b850
commit
47f003d326
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue