From 0b90110cc4fecc7c5e5ff76c6cf7b4f8f7cd6fe0 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 17 Apr 1990 17:38:15 +0000 Subject: [PATCH] check msg type before decoding git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@481 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/get_in_tkt.c | 2 ++ src/lib/krb5/krb/rd_error.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 787c93ab2..b83d95207 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -114,6 +114,8 @@ OLDDECLARG(krb5_ccache, ccache) /* now decode the reply...could be error or as_rep */ + if (!krb5_is_kdc_rep(&reply)) + return KRB5KRB_AP_ERR_MSG_TYPE; if (retval = decode_krb5_as_rep(&reply, &as_reply)) { if (decode_krb5_error(&reply, &err_reply)) return retval; /* some other reply--??? */ diff --git a/src/lib/krb5/krb/rd_error.c b/src/lib/krb5/krb/rd_error.c index bbbee8ae6..6e2e46f9b 100644 --- a/src/lib/krb5/krb/rd_error.c +++ b/src/lib/krb5/krb/rd_error.c @@ -19,6 +19,7 @@ static char rcsid_rd_error_c[] = #include #include +#include #include @@ -39,6 +40,8 @@ krb5_error *dec_error; krb5_error_code retval; krb5_error *new_dec_error; + if (!krb5_is_krb_error(enc_errbuf)) + return KRB5KRB_AP_ERR_MSG_TYPE; if (retval = decode_krb5_error(enc_errbuf, &new_dec_error)) return(retval); *dec_error = *new_dec_error; -- 2.26.2