From 99c9e358c54b170b01e614483514026fddbd2688 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 7 Jun 2010 21:26:33 +0200 Subject: ldb:pyldb.c - we cannot use "ldb_dn_compare" if both message DNs are NULL in "py_ldb_msg_compare" Discovered by the testcase. --- source4/lib/ldb/pyldb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/pyldb.c') diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index bbb2e715b3..3a956ed6e2 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -2087,9 +2087,11 @@ static int py_ldb_msg_compare(PyLdbMessageObject *py_msg1, unsigned int i; int ret; - ret = ldb_dn_compare(msg1->dn, msg2->dn); - if (ret != 0) { - return ret; + if ((msg1->dn != NULL) || (msg2->dn != NULL)) { + ret = ldb_dn_compare(msg1->dn, msg2->dn); + if (ret != 0) { + return ret; + } } ret = msg1->num_elements - msg2->num_elements; -- cgit