summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-21 21:06:46 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-21 21:06:46 +0000
commit74bd40d85cf70fa8b8b4d9280efbb721c8ef4796 (patch)
treeb619620d431c4369096484516d6a6fc3692d6e01
parentbe44991baa5282279eb14a18294d78d7358ac3ec (diff)
downloadcpython-git-74bd40d85cf70fa8b8b4d9280efbb721c8ef4796.tar.gz
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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 6af6e513d5..f18e1546eb 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8250,6 +8250,7 @@ win32_urandom(PyObject *self, PyObject *args)
result = PyString_FromStringAndSize(NULL, howMany);
if (result != NULL) {
/* Get random data */
+ memset(PyString_AS_STRING(result), 0, howMany); /* zero seed */
if (! pCryptGenRandom(hCryptProv, howMany, (unsigned char*)
PyString_AS_STRING(result))) {
Py_DECREF(result);