From: Greg Hudson Date: Thu, 5 Feb 2009 18:34:57 +0000 (+0000) Subject: In krb5_ktfileint_find_slot, check for an error return from ftell. X-Git-Tag: krb5-1.8-alpha1~712 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ddad650cc63bacc2179ffbb22c94b5fe1b55f7c;p=krb5.git In krb5_ktfileint_find_slot, check for an error return from ftell. (Such an error will never happen in any reasonable stdio implementation but it's more correct to check.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21892 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index ecdc28a25..df5cbb0ba 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -1722,6 +1722,9 @@ krb5_ktfileint_find_slot(krb5_context context, krb5_keytab id, krb5_int32 *size_ * Make sure we zero any trailing data. */ zero_point = ftell(KTFILEP(id)); + if (zero_point < 0) { + return errno; + } while ((size = fread(iobuf, 1, sizeof(iobuf), KTFILEP(id)))) { if (size != sizeof(iobuf)) { remainder = size % sizeof(krb5_int32);