]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pyldb: Fix deleting an ldb.Control critical flag
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 24 Sep 2021 23:16:09 +0000 (11:16 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Sep 2021 09:44:35 +0000 (09:44 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14845

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c
selftest/knownfail.d/python-segfaults

index ed62a3965306b6e35441a689bebcec2bf5c9f2a1..356a243f3c7bf7d45cfcdfd57357ec96659ba182 100644 (file)
@@ -182,6 +182,10 @@ static PyObject *py_ldb_control_get_critical(PyLdbControlObject *self,
 
 static int py_ldb_control_set_critical(PyLdbControlObject *self, PyObject *value, void *closure)
 {
+       if (value == NULL) {
+               PyErr_SetString(PyExc_AttributeError, "cannot delete critical flag");
+               return -1;
+       }
        if (PyObject_IsTrue(value)) {
                self->data->critical = true;
        } else {
index 0c6e52d63d4af29544c96f417c201c64954bb86f..d129dab7d474d0d121521c8529c7701fc90badef 100644 (file)
@@ -1,4 +1,3 @@
 samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_init__3
 samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dnsp_string_list
 samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dns_record
-samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_ldb_control_del_critical