(krb5_rd_safe): fix argument to krb5_data_zero, handle message size = 0
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17057 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -93,8 +93,8 @@ krb5_rd_safe(krb5_context context,
|
||||
KRB_SAFE safe;
|
||||
size_t len;
|
||||
|
||||
if (outdata)
|
||||
krb5_data_zero(outdata);
|
||||
if (outbuf)
|
||||
krb5_data_zero(outbuf);
|
||||
|
||||
if ((auth_context->flags &
|
||||
(KRB5_AUTH_CONTEXT_RET_TIME | KRB5_AUTH_CONTEXT_RET_SEQUENCE)) &&
|
||||
@@ -184,13 +184,13 @@ krb5_rd_safe(krb5_context context,
|
||||
if (ret)
|
||||
goto failure;
|
||||
|
||||
outbuf->length = safe.safe_body.user_data.length;
|
||||
outbuf->data = malloc(outbuf->length);
|
||||
if (outbuf->data == NULL) {
|
||||
if (outbuf->data == NULL && outbuf->length != 0) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
goto failure;
|
||||
}
|
||||
outbuf->length = safe.safe_body.user_data.length;
|
||||
memcpy (outbuf->data, safe.safe_body.user_data.data, outbuf->length);
|
||||
|
||||
if ((auth_context->flags &
|
||||
|
Reference in New Issue
Block a user