summaryrefslogtreecommitdiff
path: root/source3/python/py_spoolss_printers_conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/python/py_spoolss_printers_conv.c')
-rw-r--r--source3/python/py_spoolss_printers_conv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_printers_conv.c b/source3/python/py_spoolss_printers_conv.c
index 760896fcde..9bef118f2b 100644
--- a/source3/python/py_spoolss_printers_conv.c
+++ b/source3/python/py_spoolss_printers_conv.c
@@ -224,8 +224,12 @@ BOOL py_from_PRINTER_INFO_2(PyObject **dict, PRINTER_INFO_2 *info)
*dict = from_struct(info, py_PRINTER_INFO_2);
- if (py_from_SECDESC(&obj, info->secdesc))
- PyDict_SetItemString(*dict, "security_descriptor", obj);
+ /* The security descriptor could be NULL */
+
+ if (info->secdesc) {
+ if (py_from_SECDESC(&obj, info->secdesc))
+ PyDict_SetItemString(*dict, "security_descriptor", obj);
+ }
/* Bong! The devmode could be NULL */