Skip to content

Commit b391e1a

Browse files
committed
Fix possible NULL deref
1 parent 9c94cbe commit b391e1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ dummy_func(
18991899
if (PyStackRef_IsNull(v)) {
19001900
PyObject *localsplusnames = _PyFrame_GetCode(frame)->co_localsplusnames;
19011901
PyObject *name = PyTuple_GetItem(localsplusnames, oparg);
1902-
if (PyMapping_HasKeyWithError(BUILTINS(), name) == 1) {
1902+
if (name && PyMapping_HasKeyWithError(BUILTINS(), name) == 1) {
19031903
_PyEval_FormatExcCheckArg(tstate, PyExc_UnboundLocalError,
19041904
CANNOT_DELETE_BUILTIN_ERROR_MSG, name);
19051905
} else {

0 commit comments

Comments
 (0)