summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-03-23 10:27:00 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-03-23 10:59:33 -0400
commit4a72049c51d1c20be7c0c5eccdb1cc2d5d813ae5 (patch)
tree3f5592eb44e6b4701c44070de8d1b57069e8737d
parentea65835c09d4c930921b955416a91538da477639 (diff)
downloadsssd-4a72049c51d1c20be7c0c5eccdb1cc2d5d813ae5.tar.gz
sssd-4a72049c51d1c20be7c0c5eccdb1cc2d5d813ae5.tar.xz
sssd-4a72049c51d1c20be7c0c5eccdb1cc2d5d813ae5.zip
Don't crash if we get a multivalued name without an origDN
Coverity 10740 and 10739
-rw-r--r--src/db/sysdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 7446aea90..483aae95f 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -2079,7 +2079,9 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb,
goto done;
}
if (orig_dn_el->num_values == 0) {
- DEBUG(7, ("Original DN is not available.\n"));
+ DEBUG(1, ("Original DN is not available.\n"));
+ ret = EINVAL;
+ goto done;
} else if (orig_dn_el->num_values == 1) {
ret = sysdb_get_rdn(sysdb, tmpctx,
(const char *) orig_dn_el->values[0].data,