Check for null file handle in get_next.
authorKen Raeburn <raeburn@mit.edu>
Fri, 27 Jul 2007 04:38:46 +0000 (04:38 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 27 Jul 2007 04:38:46 +0000 (04:38 +0000)
Patch from Luke Howard.

ticket: 5471

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19736 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/kt_file.c

index 2652c00affe4d62d19dc5f1cbbe682b506b4f793..1d58a53eeed8919c9e27b47640cc63715889c4c8 100644 (file)
@@ -461,6 +461,10 @@ krb5_ktfile_get_next(krb5_context context, krb5_keytab id, krb5_keytab_entry *en
     kerror = KTLOCK(id);
     if (kerror)
        return kerror;
+    if (KTFILEP(id) == NULL) {
+       KTUNLOCK(id);
+       return KRB5_KT_IOERR;
+    }
     if (fseek(KTFILEP(id), *fileoff, 0) == -1) {
        KTUNLOCK(id);
        return KRB5_KT_END;