summaryrefslogtreecommitdiffstats
path: root/ipa-client
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-01-28 07:02:30 -0500
committerSimo Sorce <ssorce@redhat.com>2011-01-28 11:44:38 -0500
commita3a154d915f90fdc7789c462aeb2c1de210aca08 (patch)
tree964cd9278594cdbe24b8da48f87394ccb956b2e6 /ipa-client
parent92c57946e1fd48e48ec1b4e69fc00d1b90e114fc (diff)
downloadfreeipa-a3a154d915f90fdc7789c462aeb2c1de210aca08.tar.gz
freeipa-a3a154d915f90fdc7789c462aeb2c1de210aca08.tar.xz
freeipa-a3a154d915f90fdc7789c462aeb2c1de210aca08.zip
Fix filter_keys in ipa-getkeytab
https://fedorahosted.org/freeipa/ticket/723
Diffstat (limited to 'ipa-client')
-rw-r--r--ipa-client/ipa-getkeytab.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c
index fa6b49d62..f8da31786 100644
--- a/ipa-client/ipa-getkeytab.c
+++ b/ipa-client/ipa-getkeytab.c
@@ -478,7 +478,8 @@ int filter_keys(krb5_context krbctx, struct keys_container *keys,
krb5_free_keyblock_contents(krbctx, &ksdata[i].key);
krb5_free_data_contents(krbctx, &ksdata[i].salt);
for (j = i; j < n-1; j++) {
- keys[j] = keys[j + 1];
+ ksdata[j] = ksdata[j + 1];
+ enctypes[j] = enctypes[j + 1];
}
n--;
/* new key has been moved to this position, make sure
@@ -693,7 +694,10 @@ static int ldap_set_keytab(krb5_context krbctx,
for (i = 0; i < keys->nkeys; i++) {
ret = ber_scanf(sctrl, "{i}", &encs[i]);
- if (ret == LBER_ERROR) break;
+ if (ret == LBER_ERROR) {
+ fprintf(stderr, _("ber_scanf() failed, Invalid control ?!\n"));
+ goto error_out;
+ }
}
ret = filter_keys(krbctx, keys, encs);