summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/mk_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/mk_error.c')
-rw-r--r--crypto/heimdal/lib/krb5/mk_error.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/crypto/heimdal/lib/krb5/mk_error.c b/crypto/heimdal/lib/krb5/mk_error.c
index 2b173db..0015f45 100644
--- a/crypto/heimdal/lib/krb5/mk_error.c
+++ b/crypto/heimdal/lib/krb5/mk_error.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: mk_error.c,v 1.14 1999/12/02 17:05:11 joda Exp $");
+RCSID("$Id: mk_error.c,v 1.16 2001/05/14 06:14:49 assar Exp $");
krb5_error_code
krb5_mk_error(krb5_context context,
@@ -42,7 +42,8 @@ krb5_mk_error(krb5_context context,
const krb5_data *e_data,
const krb5_principal client,
const krb5_principal server,
- time_t ctime,
+ time_t *ctime,
+ int *cusec,
krb5_data *reply)
{
KRB_ERROR msg;
@@ -59,9 +60,8 @@ krb5_mk_error(krb5_context context,
msg.msg_type = krb_error;
msg.stime = sec;
msg.susec = usec;
- if(ctime) {
- msg.ctime = &ctime;
- }
+ msg.ctime = ctime;
+ msg.cusec = cusec;
/* Make sure we only send `protocol' error codes */
if(error_code < KRB5KDC_ERR_NONE || error_code >= KRB5_ERR_RCSID) {
if(e_text == NULL)
@@ -86,8 +86,10 @@ krb5_mk_error(krb5_context context,
buf_size = 1024;
buf = malloc (buf_size);
- if (buf == NULL)
+ if (buf == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
return ENOMEM;
+ }
do {
ret = encode_KRB_ERROR(buf + buf_size - 1,
@@ -101,6 +103,7 @@ krb5_mk_error(krb5_context context,
buf_size *= 2;
tmp = realloc (buf, buf_size);
if (tmp == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
ret = ENOMEM;
goto out;
}
@@ -114,6 +117,7 @@ krb5_mk_error(krb5_context context,
reply->length = len;
reply->data = malloc(len);
if (reply->data == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
ret = ENOMEM;
goto out;
}
OpenPOWER on IntegriCloud