Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bb9cd0

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
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.
1 parent addf8af commit 7bb9cd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5403,7 +5403,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
54035403
little_endian, is_signed);
54045404
Py_DECREF(bytes);
54055405

5406-
if (type != &PyLong_Type) {
5406+
if (long_obj != NULL && type != &PyLong_Type) {
54075407
Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type,
54085408
long_obj, NULL));
54095409
}

0 commit comments

Comments
 (0)