mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
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.
This commit is contained in:
parent
addf8afb43
commit
7bb9cd0a67
1 changed files with 1 additions and 1 deletions
|
@ -5403,7 +5403,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
|
||||||
little_endian, is_signed);
|
little_endian, is_signed);
|
||||||
Py_DECREF(bytes);
|
Py_DECREF(bytes);
|
||||||
|
|
||||||
if (type != &PyLong_Type) {
|
if (long_obj != NULL && type != &PyLong_Type) {
|
||||||
Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type,
|
Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type,
|
||||||
long_obj, NULL));
|
long_obj, NULL));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue