Commit 370f5136 authored by Victor Stinner's avatar Victor Stinner

Merge 3.5 (os.urandom, issue #27278)

parents 673ac274 b98a36e8
...@@ -10,6 +10,10 @@ What's New in Python 3.6.0 alpha 3 ...@@ -10,6 +10,10 @@ What's New in Python 3.6.0 alpha 3
Library Library
------- -------
- Issue #27278: Fix os.urandom() implementation using getrandom() on Linux.
Truncate size to INT_MAX and loop until we collected enough random bytes,
instead of casting a directly Py_ssize_t to int.
- Issue #16864: sqlite3.Cursor.lastrowid now supports REPLACE statement. - Issue #16864: sqlite3.Cursor.lastrowid now supports REPLACE statement.
Initial patch by Alex LordThorsen. Initial patch by Alex LordThorsen.
......
...@@ -146,7 +146,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int raise) ...@@ -146,7 +146,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int raise)
to 1024 bytes */ to 1024 bytes */
n = Py_MIN(size, 1024); n = Py_MIN(size, 1024);
#else #else
n = size; n = Py_MIN(size, INT_MAX);
#endif #endif
errno = 0; errno = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment