From 74bd40d85cf70fa8b8b4d9280efbb721c8ef4796 Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Mon, 21 Jul 2008 21:06:46 +0000 Subject: 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. --- Modules/posixmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 6af6e51..f18e154 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); -- cgit v0.12