mirror of https://github.com/python/cpython
gh-102509: Start initializing `ob_digit` of `_PyLongValue` (GH-102510)
This commit is contained in:
parent
a1b679572e
commit
fc130c47da
|
@ -0,0 +1,2 @@
|
||||||
|
Start initializing ``ob_digit`` during creation of :c:type:`PyLongObject`
|
||||||
|
objects. Patch by Illia Volochii.
|
|
@ -163,6 +163,9 @@ _PyLong_New(Py_ssize_t size)
|
||||||
}
|
}
|
||||||
_PyLong_SetSignAndDigitCount(result, size != 0, size);
|
_PyLong_SetSignAndDigitCount(result, size != 0, size);
|
||||||
_PyObject_Init((PyObject*)result, &PyLong_Type);
|
_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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue