Fix an unchecked use of fwrite in krb5_ktfileint_delete_entry
authorGreg Hudson <ghudson@mit.edu>
Mon, 27 Apr 2009 23:01:08 +0000 (23:01 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 27 Apr 2009 23:01:08 +0000 (23:01 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22282 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/kt_file.c

index 7fe4dcfc89585e0cde57b9dca67ef4025933ab0a..e2d164c93fc2e0aa0d97ab28db6092df0261e038 100644 (file)
@@ -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;