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

Misc/NEWS
Modules/posixmodule.c

index 9427ab232beb4cd8059171c6da1175baad26d476..3f9eee4f87e7585c7874dc7cc8b4d86e0b65c175 100644 (file)
--- 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.
 
index 8d0363e7ddf2bf598062c26b86eee1a1eca6c761..f9718f3856d65e54f02c5ff63bc697cc027ca0c2 100644 (file)
@@ -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");