From 7ddad650cc63bacc2179ffbb22c94b5fe1b55f7c Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 5 Feb 2009 18:34:57 +0000 Subject: [PATCH] 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 --- src/lib/krb5/keytab/kt_file.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.26.2