diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-07-21 21:13:14 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-07-21 21:13:14 (GMT) |
commit | a05ada3128f5cbe00ef5c51e6317cc984b102c40 (patch) | |
tree | 5640522087c0d808a4f342bd5db569dc94a00862 | |
parent | e5715f74131c8ef217fdd04195e593c0c01a66e4 (diff) | |
download | cpython-a05ada3128f5cbe00ef5c51e6317cc984b102c40.zip cpython-a05ada3128f5cbe00ef5c51e6317cc984b102c40.tar.gz cpython-a05ada3128f5cbe00ef5c51e6317cc984b102c40.tar.bz2 |
Merged revisions 65174 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65174 | amaury.forgeotdarc | 2008-07-21 23:06:46 +0200 (lun., 21 juil. 2008) | 3 lines
On Windows, silence a Purify warning and initialize the memory passed to CryptGenRandom.
Since python doesn't provide any particular random data, it seems more reasonable anyway.
........
-rw-r--r-- | Modules/posixmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index a6a19c1..bc17b6b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6690,6 +6690,7 @@ win32_urandom(PyObject *self, PyObject *args) result = PyBytes_FromStringAndSize(NULL, howMany); if (result != NULL) { /* Get random data */ + memset(PyBytes_AS_STRING(result), 0, howMany); /* zero seed */ if (! pCryptGenRandom(hCryptProv, howMany, (unsigned char*) PyBytes_AS_STRING(result))) { Py_DECREF(result); |