From: Georg Brandl Date: Wed, 6 Sep 2006 06:04:06 +0000 (+0000) Subject: Bug #1551427: fix a wrong NULL pointer check in the win32 version X-Git-Tag: v2.5c2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b20cb33f7ff837d6265ac33768b05ec212931a7e;p=python 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 9ebe288682..fe0308742d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -51,6 +51,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 5c67be6dc0..45ea9886eb 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");