diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2013-04-13 16:44:44 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2013-04-13 16:44:44 (GMT) |
commit | c9734484ca774afad49e361f72cad60d937acf1b (patch) | |
tree | 27c55159f4eb6fd31aa5a805a755422eb5b1f8c2 /Objects/abstract.c | |
parent | b4fd468f125955b14f53e77e1f29b216ca888c88 (diff) | |
download | cpython-c9734484ca774afad49e361f72cad60d937acf1b.zip cpython-c9734484ca774afad49e361f72cad60d937acf1b.tar.gz cpython-c9734484ca774afad49e361f72cad60d937acf1b.tar.bz2 |
Issue #17715: Add missing NULL Check to PyNumber_Long.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index a2737dd..7c24724 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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, |