Verify that error_code is in the range [0,127].
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4640 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -64,6 +64,12 @@ krb5_mk_error(krb5_context context,
|
|||||||
if(ctime) {
|
if(ctime) {
|
||||||
msg.ctime = &ctime;
|
msg.ctime = &ctime;
|
||||||
}
|
}
|
||||||
|
/* Make sure we only send `protocol' error codes */
|
||||||
|
if(error_code < KRB5KDC_ERR_NONE || error_code >= KRB5_ERR_RCSID) {
|
||||||
|
if(e_text == NULL)
|
||||||
|
e_text = krb5_get_err_text(context, error_code);
|
||||||
|
error_code = KRB5KRB_ERR_GENERIC;
|
||||||
|
}
|
||||||
msg.error_code = error_code - KRB5KDC_ERR_NONE;
|
msg.error_code = error_code - KRB5KDC_ERR_NONE;
|
||||||
if (e_text)
|
if (e_text)
|
||||||
msg.e_text = (general_string*)&e_text;
|
msg.e_text = (general_string*)&e_text;
|
||||||
|
Reference in New Issue
Block a user