From: Tom Yu Date: Tue, 30 Jan 2001 22:40:54 +0000 (+0000) Subject: * preauth.c (krb5_obtain_padata): Don't dereference a NULL pointer X-Git-Tag: krb5-1.3-alpha1~1671 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e1b97351c095706ea92d65f5c8e213eebbf623be;p=krb5.git * preauth.c (krb5_obtain_padata): Don't dereference a NULL pointer if we receive an empty ETYPE_INFO preauth. [krb5-libs/903 from craziboy77@hotmail.com] * preauth2.c (krb5_do_preauth): Don't dereference a NULL pointer if we receive an empty ETYPE_INFO preauth. [krb5-libs/903 from craziboy77@hotmail.com] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12977 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index d05ca178e..8c6f20a8c 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,13 @@ +2001-01-30 Tom Yu + + * preauth.c (krb5_obtain_padata): Don't dereference a NULL pointer + if we receive an empty ETYPE_INFO preauth. [krb5-libs/903 from + craziboy77@hotmail.com] + + * preauth2.c (krb5_do_preauth): Don't dereference a NULL pointer + if we receive an empty ETYPE_INFO preauth. [krb5-libs/903 from + craziboy77@hotmail.com] + 2001-01-30 Ezra Peisach * rd_req_dec.c (krb5_rd_req_decrypt_tkt_part): Free diff --git a/src/lib/krb5/krb/preauth.c b/src/lib/krb5/krb/preauth.c index 38aa82099..54f6a9539 100644 --- a/src/lib/krb5/krb/preauth.c +++ b/src/lib/krb5/krb/preauth.c @@ -172,6 +172,10 @@ krb5_error_code krb5_obtain_padata(context, preauth_to_use, key_proc, retval = decode_krb5_etype_info(&scratch, &etype_info); if (retval) return retval; + if (etype_info[0] == NULL) { + krb5_free_etype_info(context, etype_info); + etype_info = NULL; + } } } diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index d3841988e..a63747382 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -530,6 +530,11 @@ krb5_do_preauth(krb5_context context, } return ret; } + if (etype_info[0] == NULL) { + krb5_free_etype_info(context, etype_info); + etype_info = NULL; + break; + } salt->data = (char *) etype_info[0]->salt; salt->length = etype_info[0]->length; *etype = etype_info[0]->etype;