Skip to content
Merged
Prev Previous commit
Next Next commit
restore initialization of digit[0]
  • Loading branch information
skirpichev committed Apr 1, 2026
commit 613d2a1c33589edadd16498d3d59cf6a8353fd42
3 changes: 3 additions & 0 deletions Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ long_alloc(Py_ssize_t size)
_PyLong_InitTag(result);
}
_PyLong_SetSignAndDigitCount(result, size != 0, size);
/* The digit has to be initialized explicitly to avoid
* use-of-uninitialized-value. */
result->long_value.ob_digit[0] = 0;
return result;
}

Expand Down
Loading