From 845df79751acd76915d1ad72f817af78a884ea57 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 27 Apr 2009 23:01:08 +0000 Subject: [PATCH] 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 --- src/lib/krb5/keytab/kt_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.26.2