summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-kdb/ipa_kdb_common.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-09-05 14:08:02 +0200
committerMartin Kosek <mkosek@redhat.com>2012-09-05 14:20:29 +0200
commit83245bc8c978db4c2fc1ddbbc16264422875d357 (patch)
treed55f2c9c963d0c9ce474e8c70c8495db8a309c19 /daemons/ipa-kdb/ipa_kdb_common.c
parent2ede70b7209c0c85642600a60642887096a96530 (diff)
downloadfreeipa.git-83245bc8c978db4c2fc1ddbbc16264422875d357.tar.gz
freeipa.git-83245bc8c978db4c2fc1ddbbc16264422875d357.tar.xz
freeipa.git-83245bc8c978db4c2fc1ddbbc16264422875d357.zip
ipadb_iterate(): handle match_entry == NULL
If match_entry == NULL all principals should be iterated. Additionally this patch adds a check in ipadb_filter_escape() to make sure that the input is not NULL. Fixes: https://fedorahosted.org/freeipa/ticket/3011
Diffstat (limited to 'daemons/ipa-kdb/ipa_kdb_common.c')
-rw-r--r--daemons/ipa-kdb/ipa_kdb_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb_common.c b/daemons/ipa-kdb/ipa_kdb_common.c
index 6f5ac1d7..71df9634 100644
--- a/daemons/ipa-kdb/ipa_kdb_common.c
+++ b/daemons/ipa-kdb/ipa_kdb_common.c
@@ -30,6 +30,10 @@ char *ipadb_filter_escape(const char *input, bool star)
size_t i = 0;
size_t j = 0;
+ if (!input) {
+ return NULL;
+ }
+
/* Assume the worst-case. */
output = malloc(strlen(input) * 3 + 1);
if (!output) {