From: Georg Brandl Date: Wed, 6 Sep 2006 06:04:03 +0000 (+0000) Subject: Bug #1551427: fix a wrong NULL pointer check in the win32 version X-Git-Tag: v2.4.4c1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6d03114e7cb4a27c6216228796583d6f9a398b;p=thirdparty%2FPython%2Fcpython.git Bug #1551427: fix a wrong NULL pointer check in the win32 version of os.urandom(). (backport from rev. 51762) --- diff --git a/Misc/NEWS b/Misc/NEWS index 9427ab232beb..3f9eee4f87e7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -43,6 +43,9 @@ Core and builtins Extension Modules ----------------- +- Bug #1551427: fix a wrong NULL pointer check in the win32 version + of os.urandom(). + - Patch #1535500: fix segfault in BZ2File.writelines and make sure it raises the correct exceptions. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8d0363e7ddf2..f9718f3856d6 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7333,7 +7333,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");