Commit 51eba611 authored by Tim Peters's avatar Tim Peters

win32_urandom(): Raise ValueError if the argument is negative.

parent 4ad8217a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment