summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-07 21:26:33 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-07 21:26:33 +0200
commit99c9e358c54b170b01e614483514026fddbd2688 (patch)
tree16419eecc265c45e5942f60d00b9a390b5381b2e /source4/lib
parent0c3dfd7a79d48ef5bdcd996537521868e479f1a4 (diff)
downloadsamba-99c9e358c54b170b01e614483514026fddbd2688.tar.gz
samba-99c9e358c54b170b01e614483514026fddbd2688.tar.bz2
samba-99c9e358c54b170b01e614483514026fddbd2688.zip
ldb:pyldb.c - we cannot use "ldb_dn_compare" if both message DNs are NULL in "py_ldb_msg_compare"
Discovered by the testcase.
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/pyldb.c8
1 files changed, 5 insertions, 3 deletions
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;