mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #17715: Add missing NULL Check to PyNumber_Long.
This commit is contained in:
parent
b4fd468f12
commit
c9734484ca
3 changed files with 11 additions and 0 deletions
|
@ -1293,6 +1293,8 @@ PyNumber_Long(PyObject *o)
|
|||
PyObject *truncated = PyEval_CallObject(trunc_func, NULL);
|
||||
PyObject *int_instance;
|
||||
Py_DECREF(trunc_func);
|
||||
if (truncated == NULL)
|
||||
return NULL;
|
||||
/* __trunc__ is specified to return an Integral type,
|
||||
but int() needs to return a int. */
|
||||
int_instance = convert_integral_to_int(truncated,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue