pull up r19736 from trunk
authorTom Yu <tlyu@mit.edu>
Fri, 31 Aug 2007 21:38:41 +0000 (21:38 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 31 Aug 2007 21:38:41 +0000 (21:38 +0000)
 r19736@cathode-dark-space:  raeburn | 2007-07-27 00:38:46 -0400
 ticket: 5471

 Check for null file handle in get_next.
 Patch from Luke Howard.

ticket: 5471
version_fixed: 1.6.3

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19907 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/kt_file.c

index 92947d5936ba49a0edce63e9047cb5c024a39674..776727a01e9b980bcb58593f0fecedc50f02fddf 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;