Skip to content

Commit 613d2a1

Browse files
committed
restore initialization of digit[0]
1 parent 640b326 commit 613d2a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/longobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ long_alloc(Py_ssize_t size)
188188
_PyLong_InitTag(result);
189189
}
190190
_PyLong_SetSignAndDigitCount(result, size != 0, size);
191+
/* The digit has to be initialized explicitly to avoid
192+
* use-of-uninitialized-value. */
193+
result->long_value.ob_digit[0] = 0;
191194
return result;
192195
}
193196

0 commit comments

Comments
 (0)