Don't dump core when principal doesn't exist
authorSam Hartman <hartmans@mit.edu>
Sat, 10 Aug 1996 04:23:56 +0000 (04:23 +0000)
committerSam Hartman <hartmans@mit.edu>
Sat, 10 Aug 1996 04:23:56 +0000 (04:23 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8919 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/ChangeLog
src/lib/kdb/keytab.c

index 98e8c95a4bf751a7b72f4d64b0dc70481b34233c..f579c79937ed09bef047aaa7a44b85052d2fe4b4 100644 (file)
@@ -8,9 +8,15 @@ Thu Aug  8 20:26:47 1996  Tom Yu  <tlyu@mit.edu>
        * Makefile.in (shared): Always mkdir shared; test -d shared ||
                mkdir shared breaks under Ultrix sh (grrr...).
 
+Thu Aug  8 18:29:15 1996  Sam Hartman  <hartmans@mit.edu>
+
+       * keytab.c (krb5_ktkdb_get_entry): Return KRB5_KT_NOTFOUND if the
+       principal doesn't exist instead of dereferencing a null pointer.
+
 Fri Aug  2 14:08:03 1996  Sam Hartman  <hartmans@mit.edu>
 
-       * configure.in(LIBS): AIX wants to link against -ldb when building the shared lib.
+       * configure.in(LIBS): AIX wants to link against -ldb when building
+       the shared lib.
 
 Mon Jul 29 23:07:14 1996  Samuel D Hartman  (hartmans@vorlon)
 
index 7609274d30e4176684df446183e7165a2967e7fd..c32b742173bc40a1b791c59fea155c9aee0052e0 100644 (file)
@@ -120,6 +120,11 @@ krb5_ktkdb_get_entry(context, id, principal, kvno, enctype, entry)
         return(kerror);
     }
 
+    if (n != 1)
+      {
+       krb5_dbm_db_close_database(context);
+       return KRB5_KT_NOTFOUND;
+      }
     /* match key */
     krb5_dbm_db_get_mkey(context, id->ops, &master_key);
     krb5_dbe_find_enctype(context, &db_entry, enctype, -1, kvno, &key_data);