int len;
{
int ret;
+ unsigned ulen = len;
- ret = read(((krb5_fcc_data *) id->data)->fd, (char *) buf, len);
+ ret = read(((krb5_fcc_data *) id->data)->fd, (char *) buf, ulen);
if (ret == -1)
return krb5_fcc_interpret(context, errno);
else if (ret != len)
return KRB5_OK;
}
- data->data = (char *) malloc(data->length+1);
+ data->data = (char *) malloc((unsigned) data->length+1);
if (data->data == NULL)
return KRB5_CC_NOMEM;
if (addr->length == 0)
return KRB5_OK;
- addr->contents = (krb5_octet *) malloc(addr->length);
+ addr->contents = (krb5_octet *) malloc((unsigned) addr->length);
if (addr->contents == NULL)
return KRB5_CC_NOMEM;
if (a->length == 0 )
return KRB5_OK;
- a->contents = (krb5_octet *) malloc(a->length);
+ a->contents = (krb5_octet *) malloc((unsigned) a->length);
if (a->contents == NULL)
return KRB5_CC_NOMEM;
int len;
{
int ret;
+ unsigned int ulen = len;
- ret = write(((krb5_fcc_data *)id->data)->fd, (char *) buf, len);
+ ret = write(((krb5_fcc_data *)id->data)->fd, (char *) buf, ulen);
if (ret < 0)
return krb5_fcc_interpret(context, errno);
if (ret != len)
krb5_error_code kret;
krb5_ui_2 fcc_flen;
- lseek(data->fd, sizeof(krb5_ui_2), SEEK_SET);
+ lseek(data->fd, (off_t) sizeof(krb5_ui_2), SEEK_SET);
if (data->version == KRB5_FCC_FVNO_4) {
kret = krb5_fcc_read_ui_2(context, id, &fcc_flen);
if (kret) return kret;
- if(lseek(data->fd, fcc_flen, SEEK_CUR) < 0)
+ if(lseek(data->fd, (off_t) fcc_flen, SEEK_CUR) < 0)
return errno;
}
return KRB5_OK;
((krb5_fcc_data *) id->data)->fd = ret;
}
else
- lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_SET);
+ lseek(((krb5_fcc_data *) id->data)->fd, (off_t) 0, SEEK_SET);
#ifdef MSDOS_FILESYSTEM
/* "disgusting bit of UNIX trivia" - that's how the writers of NFS describe
kret = krb5_fcc_skip_principal(context, id);
if (kret) goto done;
- fcursor->pos = lseek(data->fd, 0, SEEK_CUR);
+ fcursor->pos = lseek(data->fd, (off_t) 0, SEEK_CUR);
*cursor = (krb5_cc_cursor) fcursor;
done:
kret = krb5_fcc_read_data(context, id, &creds->second_ticket);
TCHECK(kret);
- fcursor->pos = lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_CUR);
+ fcursor->pos = lseek(((krb5_fcc_data *) id->data)->fd, (off_t) 0,
+ SEEK_CUR);
cursor = (krb5_cc_cursor *) fcursor;
lose:
MAYBE_OPEN(context, id, FCC_OPEN_RDWR);
/* Make sure we are writing to the end of the file */
- ret = lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_END);
+ ret = lseek(((krb5_fcc_data *) id->data)->fd, (off_t) 0, SEEK_END);
if (ret < 0) {
MAYBE_CLOSE_IGNORE(context, id);
return krb5_fcc_interpret(context, errno);
TCHECK(ret);
ret = krb5_fcc_store_times(context, id, &creds->times);
TCHECK(ret);
- ret = krb5_fcc_store_octet(context, id, creds->is_skey);
+ ret = krb5_fcc_store_octet(context, id, (krb5_int32) creds->is_skey);
TCHECK(ret);
ret = krb5_fcc_store_int32(context, id, creds->ticket_flags);
TCHECK(ret);
int len;
{
int ret;
+ unsigned int ulen = len;
errno = 0;
- ret = fread((char *) buf, 1, len, ((krb5_scc_data *) id->data)->file);
+ ret = fread((char *) buf, 1, ulen, ((krb5_scc_data *) id->data)->file);
if ((ret == 0) && errno)
return krb5_scc_interpret(context, errno);
else if (ret != len)
/* Make *addrs able to hold length pointers to krb5_address structs
* Add one extra for a null-terminated list
*/
- *addrs = (krb5_address **) calloc(length+1, sizeof(krb5_address *));
+ *addrs = (krb5_address **) calloc((unsigned) length+1,
+ sizeof(krb5_address *));
if (*addrs == NULL)
return KRB5_CC_NOMEM;
return KRB5_OK;
}
- data->data = (char *) malloc(data->length+1);
+ data->data = (char *) malloc((unsigned int) data->length+1);
if (data->data == NULL)
return KRB5_CC_NOMEM;
if (addr->length == 0)
return KRB5_OK;
- addr->contents = (krb5_octet *) malloc(addr->length);
+ addr->contents = (krb5_octet *) malloc((unsigned) addr->length);
if (addr->contents == NULL)
return KRB5_CC_NOMEM;
/* Make *a able to hold length pointers to krb5_authdata structs
* Add one extra for a null-terminated list
*/
- *a = (krb5_authdata **) calloc(length+1, sizeof(krb5_authdata *));
+ *a = (krb5_authdata **) calloc((unsigned) length+1,
+ sizeof(krb5_authdata *));
if (*a == NULL)
return KRB5_CC_NOMEM;
if (a->length == 0 )
return KRB5_OK;
- a->contents = (krb5_octet *) malloc(a->length);
+ a->contents = (krb5_octet *) malloc((unsigned) a->length);
if (a->contents == NULL)
return KRB5_CC_NOMEM;
int len;
{
int ret;
+ unsigned int ulen = len;
errno = 0;
- ret = fwrite((char *) buf, 1, len, ((krb5_scc_data *)id->data)->file);
+ ret = fwrite((char *) buf, 1, ulen, ((krb5_scc_data *)id->data)->file);
if ((ret == 0) && errno) {
return krb5_scc_interpret (context, errno);
} else if (ret != len)
TCHECK(ret);
ret = krb5_scc_store_times(context, id, &creds->times);
TCHECK(ret);
- ret = krb5_scc_store_octet(context, id, creds->is_skey);
+ ret = krb5_scc_store_octet(context, id, (krb5_int32) creds->is_skey);
TCHECK(ret);
ret = krb5_scc_store_int32(context, id, creds->ticket_flags);
TCHECK(ret);