mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-102509: Start initializing ob_digit
of _PyLongValue
(GH-102510)
This commit is contained in:
parent
a1b679572e
commit
fc130c47da
2 changed files with 5 additions and 0 deletions
|
@ -163,6 +163,9 @@ _PyLong_New(Py_ssize_t size)
|
|||
}
|
||||
_PyLong_SetSignAndDigitCount(result, size != 0, size);
|
||||
_PyObject_Init((PyObject*)result, &PyLong_Type);
|
||||
/* The digit has to be initialized explicitly to avoid
|
||||
* use-of-uninitialized-value. */
|
||||
result->long_value.ob_digit[0] = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue