From b1c1b4eb0a62f5d508e1e890706f83309386bc5f Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 23 Feb 2009 19:30:36 +0000 Subject: [PATCH] Check the return value of fseek in two places in kt_file.c git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22047 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/kt_file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index df5cbb0ba..6e535432c 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -795,7 +795,9 @@ krb5_ktf_keytab_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octe keytab); if (!kret) { fpos = foff; /* XX range check? */ - fseek(KTFILEP(keytab), fpos, SEEK_SET); + if (fseek(KTFILEP(keytab), fpos, + SEEK_SET) == -1) + kret = errno; } } kret = 0; @@ -1437,7 +1439,11 @@ krb5_ktfileint_internal_read_entry(krb5_context context, krb5_keytab id, krb5_ke /* * Reposition file pointer to the next inter-record length field. */ - fseek(KTFILEP(id), start_pos + size, SEEK_SET); + if (fseek(KTFILEP(id), start_pos + size, SEEK_SET) == -1) { + error = errno; + goto fail; + } + return 0; fail: -- 2.26.2