Skip to content

Commit cf8b9c3

Browse files
committed
Check callable isn't NULL in _PyObject_CallMethodFormat
1 parent 3596dba commit cf8b9c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/call.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,9 @@ _Py_COMP_DIAG_POP
729729
PyObject * _PyObject_CallMethodFormat(PyThreadState *tstate, PyObject *callable,
730730
const char *format, ...)
731731
{
732+
if (callable == NULL) {
733+
return NULL;
734+
}
732735
va_list va;
733736
va_start(va, format);
734737
PyObject *retval = callmethod(tstate, callable, format, va);

0 commit comments

Comments
 (0)