The security descriptor in a PRINTER_INFO_2 could be NULL. (Bong?)
authorTim Potter <tpot@samba.org>
Wed, 25 Sep 2002 06:25:02 +0000 (06:25 +0000)
committerTim Potter <tpot@samba.org>
Wed, 25 Sep 2002 06:25:02 +0000 (06:25 +0000)
(This used to be commit 7ce782c20c6b9e515a2fa831315ae14c66d322ee)

source3/python/py_spoolss_printers_conv.c

index 760896fcdef33f7be239356d749b1c68fec1d918..9bef118f2baa4c325f1cc77b1dd73f8be440827b 100644 (file)
@@ -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 */