parking_lot.c should check for overflow in Windows _PySemaphore_PlatformWait code path
#112804
Labels
3.13
bugs and security fixes
OS-windows
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
The cast in
millis = (DWORD) (timeout / 1000000);may overflow becauseDWORDis an unsigned 32-bit integer andtimeoutis a 64-bit integer. We should clamp the result if the cast would overflow.cpython/Python/parking_lot.c
Lines 93 to 105 in cc7e45c
Noticed by @vstinner in #112733 (review)
Linked PRs
The text was updated successfully, but these errors were encountered: