{
krb5_octet vno;
krb5_int16 count;
+ unsigned int u_count, u_princ_size;
krb5_int16 enctype;
krb5_int16 princ_size;
register int i;
if (!ret_entry->principal)
return ENOMEM;
+ u_count = count;
ret_entry->principal->magic = KV5M_PRINCIPAL;
- ret_entry->principal->length = count;
- ret_entry->principal->data = (krb5_data *)calloc(count, sizeof(krb5_data));
+ ret_entry->principal->length = u_count;
+ ret_entry->principal->data = (krb5_data *)
+ calloc(u_count, sizeof(krb5_data));
if (!ret_entry->principal->data) {
free(ret_entry->principal);
ret_entry->principal = 0;
error = KRB5_KT_END;
goto fail;
}
- krb5_princ_set_realm_length(context, ret_entry->principal, princ_size);
- tmpdata = malloc(princ_size+1);
+ u_princ_size = princ_size;
+
+ krb5_princ_set_realm_length(context, ret_entry->principal, u_princ_size);
+ tmpdata = malloc(u_princ_size+1);
if (!tmpdata) {
error = ENOMEM;
goto fail;
}
- if (fread(tmpdata, 1, princ_size, KTFILEP(id)) != (size_t) princ_size) {
+ if (fread(tmpdata, 1, u_princ_size, KTFILEP(id)) != (size_t) princ_size) {
free(tmpdata);
error = KRB5_KT_END;
goto fail;
goto fail;
}
- princ->length = princ_size;
- princ->data = malloc(princ_size+1);
+ u_princ_size = princ_size;
+ princ->length = u_princ_size;
+ princ->data = malloc(u_princ_size+1);
if (!princ->data) {
error = ENOMEM;
goto fail;
}
- if (!xfread(princ->data, sizeof(char), princ_size, KTFILEP(id))) {
+ if (!xfread(princ->data, sizeof(char), u_princ_size, KTFILEP(id))) {
error = KRB5_KT_END;
goto fail;
}
error = KRB5_KT_END;
goto fail;
}
- ret_entry->key.length = count;
+
+ u_count = count;
+ ret_entry->key.length = u_count;
- ret_entry->key.contents = (krb5_octet *)malloc(count);
+ ret_entry->key.contents = (krb5_octet *)malloc(u_count);
if (!ret_entry->key.contents) {
error = ENOMEM;
goto fail;
krb5_keytab FAR *ktid;
{
struct krb5_kt_typelist *tlist;
- char *pfx, *resid, *cp;
- int pfxlen;
+ char *pfx;
+ unsigned int pfxlen;
+ const char *cp, *resid;
cp = strchr (name, ':');
if (!cp) {
return (*krb5_kt_dfl_ops.resolve)(context, name, ktid);
}
- pfxlen = cp - (char *)name;
- resid = (char *)name + pfxlen + 1;
+ pfxlen = cp - name;
+ resid = name + pfxlen + 1;
pfx = malloc (pfxlen+1);
if (!pfx)