]> granicus.if.org Git - python/commit
bpo-27645, sqlite: Fix integer overflow on sleep (#6594)
authorVictor Stinner <vstinner@redhat.com>
Mon, 30 Apr 2018 10:22:17 +0000 (12:22 +0200)
committerGitHub <noreply@github.com>
Mon, 30 Apr 2018 10:22:17 +0000 (12:22 +0200)
commitca405017d5e776a2e3d9291236e62d2e09489dd2
tree54f7f13f52fde86c9ec8d89dd9a13c18a6ca3e72
parent5ff3a161c8a6b525c5e5b3e36e9c43f5a95bda60
bpo-27645, sqlite: Fix integer overflow on sleep (#6594)

Use the _PyTime_t type and round away from zero (ROUND_UP,
_PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python
object to seconds and then to milliseconds. Raise an OverflowError in
case of overflow.

Previously the (int)double conversion rounded towards zero
(ROUND_DOWN).
Modules/_sqlite/connection.c