Check the return value of fseek in two places in kt_file.c
authorGreg Hudson <ghudson@mit.edu>
Mon, 23 Feb 2009 19:30:36 +0000 (19:30 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 23 Feb 2009 19:30:36 +0000 (19:30 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22047 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/kt_file.c

index df5cbb0bac6a5bf520a3842d9eb88200950bea13..6e535432c7680f71eaa2ac47a22716bd7b4abb0b 100644 (file)
@@ -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: