From 26a6fb956b2fbed474436578704898de6fbe229c Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sat, 19 Jul 2003 20:03:10 +0000 Subject: [PATCH] krb5_gss_register_acceptor_identity does not allocate enough memory for cached keytab * acquire_cred.c (krb5_gss_register_acceptor_identity): Allocate enough memory to include the null at the end of the keytab char *. Essentially off by one error. ticket: new target_version: 1.3.1 tags: pullup component: krb5-libs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15699 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 5 +++++ src/lib/gssapi/krb5/acquire_cred.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 44ba4200e..0fea901d3 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,8 @@ +2003-07-19 Ezra Peisach + + * acquire_cred.c (krb5_gss_register_acceptor_identity): Allocate + enough memory to include the null at the end of the keytab char *. + 2003-07-17 Tom Yu * gssapiP_krb5.h: Delete kg_release_defcred(); it's no longer diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 27cbab0bb..391575ddc 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -92,7 +92,7 @@ krb5_gss_register_acceptor_identity(const char *keytab) free(krb5_gss_keytab); len = strlen(keytab); - krb5_gss_keytab = malloc(len); + krb5_gss_keytab = malloc(len + 1); if (krb5_gss_keytab == NULL) return GSS_S_FAILURE; -- 2.26.2