From: Greg Hudson Date: Mon, 27 Apr 2009 23:01:08 +0000 (+0000) Subject: Fix an unchecked use of fwrite in krb5_ktfileint_delete_entry X-Git-Tag: krb5-1.8-alpha1~524 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=845df79751acd76915d1ad72f817af78a884ea57;p=krb5.git Fix an unchecked use of fwrite in krb5_ktfileint_delete_entry git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22282 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 7fe4dcfc8..e2d164c93 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -1225,7 +1225,9 @@ krb5_ktfileint_delete_entry(krb5_context context, krb5_keytab id, krb5_int32 del memset(iobuf, 0, (size_t) len); while (size > 0) { - fwrite(iobuf, 1, (size_t) len, KTFILEP(id)); + if (!fwrite(iobuf, 1, (size_t) len, KTFILEP(id))) { + return KRB5_KT_IOERR; + } size -= len; if (size < len) { len = size;