From: Sam Hartman Date: Sat, 10 Aug 1996 04:23:56 +0000 (+0000) Subject: Don't dump core when principal doesn't exist X-Git-Tag: krb5-1.0-beta7~163 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3406649db5f1469d73674892b71caaf251b55826;p=krb5.git Don't dump core when principal doesn't exist git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8919 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 98e8c95a4..f579c7993 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -8,9 +8,15 @@ Thu Aug 8 20:26:47 1996 Tom Yu * 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 + + * 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 - * 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) diff --git a/src/lib/kdb/keytab.c b/src/lib/kdb/keytab.c index 7609274d3..c32b74217 100644 --- a/src/lib/kdb/keytab.c +++ b/src/lib/kdb/keytab.c @@ -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);