Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
diff --git a/Misc/NEWS b/Misc/NEWS
index c0649ae..a010b0a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -41,6 +41,9 @@
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 5c67be6..45ea988 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7877,7 +7877,7 @@
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(
hAdvAPI32, "CryptGenRandom");
- if (pCryptAcquireContext == NULL)
+ if (pCryptGenRandom == NULL)
return PyErr_Format(PyExc_NotImplementedError,
"CryptGenRandom not found");