diff options
author | Tim Potter <tpot@samba.org> | 2002-09-19 05:39:03 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-09-19 05:39:03 +0000 |
commit | 86c7c460ca6c099f3593a092581ee5364179e481 (patch) | |
tree | 80ebf9e1af6744f3f5d5abff18a08f3353568789 /source3/python/py_spoolss_printers_conv.c | |
parent | a39dcb606dff72c2b851e692224b8ec1140e093c (diff) | |
download | samba-86c7c460ca6c099f3593a092581ee5364179e481.tar.gz samba-86c7c460ca6c099f3593a092581ee5364179e481.tar.bz2 samba-86c7c460ca6c099f3593a092581ee5364179e481.zip |
Bong! The devmode could be NULL. Don't crash if this is the case.
(This used to be commit 3ce8f8c50c0adcedc38bf2812b7e9fae78942458)
Diffstat (limited to 'source3/python/py_spoolss_printers_conv.c')
-rw-r--r-- | source3/python/py_spoolss_printers_conv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_printers_conv.c b/source3/python/py_spoolss_printers_conv.c index 247db65b1e..760896fcde 100644 --- a/source3/python/py_spoolss_printers_conv.c +++ b/source3/python/py_spoolss_printers_conv.c @@ -227,8 +227,14 @@ BOOL py_from_PRINTER_INFO_2(PyObject **dict, PRINTER_INFO_2 *info) if (py_from_SECDESC(&obj, info->secdesc)) PyDict_SetItemString(*dict, "security_descriptor", obj); - if (py_from_DEVICEMODE(&obj, info->devmode)) - PyDict_SetItemString(*dict, "device_mode", obj); + /* Bong! The devmode could be NULL */ + + if (info->devmode) + py_from_DEVICEMODE(&obj, info->devmode); + else + obj = PyDict_New(); + + PyDict_SetItemString(*dict, "device_mode", obj); PyDict_SetItemString(*dict, "level", PyInt_FromLong(2)); |