diff options
-rw-r--r-- | source3/python/py_spoolss_printers.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c index 48321500e7..623e693124 100644 --- a/source3/python/py_spoolss_printers.c +++ b/source3/python/py_spoolss_printers.c @@ -119,12 +119,19 @@ PyObject *spoolss_getprinter(PyObject *self, PyObject *args, PyObject *kw) int level = 1; uint32 needed; static char *kwlist[] = {"level", NULL}; - + /* Parse parameters */ if (!PyArg_ParseTupleAndKeywords(args, kw, "|i", kwlist, &level)) return NULL; + if (level < 0 || level > 3) { + PyErr_SetString(spoolss_error, "Invalid info level"); + return NULL; + } + + ZERO_STRUCT(ctr); + /* Call rpc function */ werror = cli_spoolss_getprinter( |