summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-10-05 21:02:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-10-05 21:02:23 (GMT)
commit7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c (patch)
treec30462e3098460850f3d7e082b656d4a558fac68 /Objects
parentaddf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 (diff)
downloadcpython-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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/longobject.c2
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));
}