summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/kadm5/marshall.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/kadm5/marshall.c')
-rw-r--r--crypto/heimdal/lib/kadm5/marshall.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/crypto/heimdal/lib/kadm5/marshall.c b/crypto/heimdal/lib/kadm5/marshall.c
index 9828837..05ca33f 100644
--- a/crypto/heimdal/lib/kadm5/marshall.c
+++ b/crypto/heimdal/lib/kadm5/marshall.c
@@ -33,7 +33,7 @@
#include "kadm5_locl.h"
-RCSID("$Id: marshall.c,v 1.6 1999/12/02 17:05:06 joda Exp $");
+RCSID("$Id: marshall.c 21745 2007-07-31 16:11:25Z lha $");
kadm5_ret_t
kadm5_store_key_data(krb5_storage *sp,
@@ -105,7 +105,7 @@ kadm5_ret_tl_data(krb5_storage *sp,
static kadm5_ret_t
store_principal_ent(krb5_storage *sp,
kadm5_principal_ent_t princ,
- u_int32_t mask)
+ uint32_t mask)
{
int i;
@@ -173,7 +173,7 @@ kadm5_store_principal_ent(krb5_storage *sp,
kadm5_ret_t
kadm5_store_principal_ent_mask(krb5_storage *sp,
kadm5_principal_ent_t princ,
- u_int32_t mask)
+ uint32_t mask)
{
krb5_store_int32(sp, mask);
return store_principal_ent (sp, princ, mask);
@@ -182,7 +182,7 @@ kadm5_store_principal_ent_mask(krb5_storage *sp,
static kadm5_ret_t
ret_principal_ent(krb5_storage *sp,
kadm5_principal_ent_t princ,
- u_int32_t mask)
+ uint32_t mask)
{
int i;
int32_t tmp;
@@ -260,6 +260,8 @@ ret_principal_ent(krb5_storage *sp,
krb5_ret_int32(sp, &tmp);
princ->n_key_data = tmp;
princ->key_data = malloc(princ->n_key_data * sizeof(*princ->key_data));
+ if (princ->key_data == NULL)
+ return ENOMEM;
for(i = 0; i < princ->n_key_data; i++)
kadm5_ret_key_data(sp, &princ->key_data[i]);
}
@@ -269,6 +271,8 @@ ret_principal_ent(krb5_storage *sp,
princ->tl_data = NULL;
for(i = 0; i < princ->n_tl_data; i++){
krb5_tl_data *tp = malloc(sizeof(*tp));
+ if (tp == NULL)
+ return ENOMEM;
kadm5_ret_tl_data(sp, tp);
tp->tl_data_next = princ->tl_data;
princ->tl_data = tp;
@@ -287,7 +291,7 @@ kadm5_ret_principal_ent(krb5_storage *sp,
kadm5_ret_t
kadm5_ret_principal_ent_mask(krb5_storage *sp,
kadm5_principal_ent_t princ,
- u_int32_t *mask)
+ uint32_t *mask)
{
int32_t tmp;
@@ -319,8 +323,10 @@ _kadm5_unmarshal_params(krb5_context context,
kadm5_config_params *params)
{
krb5_storage *sp = krb5_storage_from_data(in);
+ int32_t mask;
- krb5_ret_int32(sp, &params->mask);
+ krb5_ret_int32(sp, &mask);
+ params->mask = mask;
if(params->mask & KADM5_CONFIG_REALM)
krb5_ret_string(sp, &params->realm);
OpenPOWER on IntegriCloud