]> granicus.if.org Git - python/commitdiff
Bug #1551427: fix a wrong NULL pointer check in the win32 version
authorGeorg Brandl <georg@python.org>
Wed, 6 Sep 2006 06:04:06 +0000 (06:04 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 6 Sep 2006 06:04:06 +0000 (06:04 +0000)
of os.urandom().
 (backport from rev. 51762)

Misc/NEWS
Modules/posixmodule.c

index 9ebe288682c87af349cb5f2bebcd90fe0198e598..fe0308742d0068a4390e95d5f91820de6c46b09d 100644 (file)
--- 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.
index 5c67be6dc08e4df0e308ad8b9a4769b0badb2ae0..45ea9886ebf40ca151b68e8f16e53c471ee0c41b 100644 (file)
@@ -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");