diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-10-05 21:24:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-05 21:24:25 (GMT) |
commit | 526929be39e139a7d89f4c363d79c28566f30d71 (patch) | |
tree | 1294248f3f517f56c9c04e02b8a538942de85b3d | |
parent | dd0670f12b159eff5336d6011f046e1ccac495e1 (diff) | |
download | cpython-526929be39e139a7d89f4c363d79c28566f30d71.zip cpython-526929be39e139a7d89f4c363d79c28566f30d71.tar.gz cpython-526929be39e139a7d89f4c363d79c28566f30d71.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.
(cherry picked from commit 7bb9cd0a6766fd3e7b3c1e8f2315304ae192b34c)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
-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 c3c0949..3864cec 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5302,7 +5302,7 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds) 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)); } |