From 720634c14e6bbe530185cd9b01ec55d3cc8867b6 Mon Sep 17 00:00:00 2001 From: Matthew Hancher Date: Mon, 10 Aug 1998 21:53:22 +0000 Subject: [PATCH] Mon Aug 10 17:51:59 1998 Matthew D Hancher * rd_svc_key.c (read_service_key): Don't call krb5_kt_close() if krb5_kt_resolve() fails, so we don't segfault if the keytab name is invalid. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10800 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb4/ChangeLog | 6 ++++++ src/lib/krb4/rd_svc_key.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 0134656df..54e185d2e 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,9 @@ +Mon Aug 10 17:51:59 1998 Matthew D Hancher + + * rd_svc_key.c (read_service_key): Don't call krb5_kt_close() if + krb5_kt_resolve() fails, so we don't segfault if the keytab name + is invalid. + Fri Aug 7 11:04:03 1998 Tom Yu * rd_safe.c (krb_rd_safe): Fix up call to quad_cksum(). diff --git a/src/lib/krb4/rd_svc_key.c b/src/lib/krb4/rd_svc_key.c index 5ef12d8eb..34924baf5 100644 --- a/src/lib/krb4/rd_svc_key.c +++ b/src/lib/krb4/rd_svc_key.c @@ -166,10 +166,11 @@ read_service_key(service,instance,realm,kvno,file,key) sizeof(keytabname)-1); if (!retval) { retval = krb5_kt_resolve(context, (char *)keytabname, &kt_id); - if (!retval) + if (!retval) { retval = krb5_kt_get_entry(context, kt_id, princ, kvno, ENCTYPE_DES_CBC_CRC, &kt_entry); - krb5_kt_close(context, kt_id); + krb5_kt_close(context, kt_id); + } krb5_free_principal(context, princ); } if (!retval) { -- 2.26.2