summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/posixmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index af60f0c..477a135 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7246,6 +7246,9 @@ win32_urandom(PyObject *self, PyObject *args)
/* Read arguments */
if (! PyArg_ParseTuple(args, "i", &howMany))
return NULL;
+ if (howMany < 0)
+ return PyErr_Format(PyExc_ValueError,
+ "negative argument not allowed");
if (hCryptProv == 0) {
HINSTANCE hAdvAPI32 = NULL;