diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-10-05 21:02:23 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-10-05 21:02:23 (GMT) |
commit | 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c (patch) | |
tree | c30462e3098460850f3d7e082b656d4a558fac68 | |
parent | addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 (diff) | |
download | cpython-7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c.zip cpython-7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c.tar.gz cpython-7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c.tar.bz2 |
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705)
The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.
-rw-r--r-- | Objects/longobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index afe30bc..ae3a98c 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5403,7 +5403,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj, little_endian, is_signed); Py_DECREF(bytes); - if (type != &PyLong_Type) { + if (long_obj != NULL && type != &PyLong_Type) { Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type, long_obj, NULL)); } |