From: Georg Brandl Date: Wed, 6 Sep 2006 06:03:59 +0000 (+0000) Subject: Bug #1551427: fix a wrong NULL pointer check in the win32 version X-Git-Tag: v2.6a1~2694 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74bb783c2fd8084a835b6663abe5b70c55fa999d;p=thirdparty%2FPython%2Fcpython.git Bug #1551427: fix a wrong NULL pointer check in the win32 version of os.urandom(). --- diff --git a/Misc/NEWS b/Misc/NEWS index c0649ae6dfa5..a010b0a22d1c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -41,6 +41,9 @@ Library Extension Modules ----------------- +- Bug #1551427: fix a wrong NULL pointer check in the win32 version + of os.urandom(). + - Bug #1548092: fix curses.tparm seg fault on invalid input. - Bug #1550714: fix SystemError from itertools.tee on negative value for n. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5c67be6dc08e..45ea9886ebf4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7877,7 +7877,7 @@ win32_urandom(PyObject *self, PyObject *args) pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress( hAdvAPI32, "CryptGenRandom"); - if (pCryptAcquireContext == NULL) + if (pCryptGenRandom == NULL) return PyErr_Format(PyExc_NotImplementedError, "CryptGenRandom not found");