Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-27645, sqlite: Fix integer overflow on sleep#6594

Merged
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:sqlite_time_tCopy head branch name to clipboard
Apr 30, 2018
Merged

bpo-27645, sqlite: Fix integer overflow on sleep#6594
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:sqlite_time_tCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Apr 25, 2018

Copy link
Copy Markdown
Member

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).

https://bugs.python.org/issue27645

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).
@vstinner

Copy link
Copy Markdown
Member Author

cc @lelit

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@vstinner vstinner merged commit ca40501 into python:master Apr 30, 2018
@bedevere-bot

Copy link
Copy Markdown

@vstinner: Please replace # with GH- in the commit message next time. Thanks!

@vstinner vstinner deleted the sqlite_time_t branch April 30, 2018 10:22
@vstinner

Copy link
Copy Markdown
Member Author

Thanks for your reviews @berkerpeksag and @serhiy-storchaka!

vstinner added a commit that referenced this pull request Apr 23, 2019
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.

(cherry picked from commit edad38e)

* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)

ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.

(cherry picked from commit fb7e799)

* bpo-9566: Fix compiler warnings in peephole.c (GH-10652)

(cherry picked from commit 028f0ef)

* 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).

(cherry picked from commit ca40501)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.