From: Ken Raeburn Date: Fri, 27 Jul 2007 04:38:46 +0000 (+0000) Subject: Check for null file handle in get_next. X-Git-Tag: krb5-1.7-alpha1~989 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bfe0abf978c102e89fdd093d6334d239af754cce;p=krb5.git Check for null file handle in get_next. Patch from Luke Howard. ticket: 5471 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19736 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 2652c00af..1d58a53ee 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -461,6 +461,10 @@ krb5_ktfile_get_next(krb5_context context, krb5_keytab id, krb5_keytab_entry *en kerror = KTLOCK(id); if (kerror) return kerror; + if (KTFILEP(id) == NULL) { + KTUNLOCK(id); + return KRB5_KT_IOERR; + } if (fseek(KTFILEP(id), *fileoff, 0) == -1) { KTUNLOCK(id); return KRB5_KT_END;