[New-bugs-announce] [issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

Thomas Grainger report at bugs.python.org
Thu Jan 9 09:43:45 EST 2020


New submission from Thomas Grainger <tagrain at gmail.com>:

_PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

Python 3.7.5 (default, Nov 20 2019, 09:21:52) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.sleep(9223372036.854777)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: sleep length must be non-negative

----------
messages: 359682
nosy: graingert, vstinner
priority: normal
severity: normal
status: open
title: _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t
type: behavior
versions: Python 2.7, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39277>
_______________________________________


More information about the New-bugs-announce mailing list