diff options
Diffstat (limited to 'source3/python/py_spoolss_ports.c')
-rw-r--r-- | source3/python/py_spoolss_ports.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_ports.c b/source3/python/py_spoolss_ports.c index 8d59274a00..b5f2102e5e 100644 --- a/source3/python/py_spoolss_ports.c +++ b/source3/python/py_spoolss_ports.c @@ -40,8 +40,12 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) args, kw, "s|iO", kwlist, &server, &level, &creds)) return NULL; - if (server[0] == '\\' && server[1] == '\\') - server += 2; + if (server[0] != '\\' || server[1] != '\\') { + PyErr_SetString(PyExc_ValueError, "UNC name required"); + return NULL; + } + + server += 2; if (creds && creds != Py_None && !PyDict_Check(creds)) { PyErr_SetString(PyExc_TypeError, |