From: Ezra Peisach Date: Sun, 12 Jan 2003 17:36:53 +0000 (+0000) Subject: * svc_auth_gssapi.c (_svcauth_gssapi_unset_names): If invoked more X-Git-Tag: krb5-1.3-alpha1~163 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e043c6b20ad6fbebfb17de34ee10409ba89a4277;p=krb5.git * svc_auth_gssapi.c (_svcauth_gssapi_unset_names): If invoked more than once, do not double free memory. * clnt_perror.c (clnt_sperror): Do not write past end of allocated buffer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15114 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 4b8e7ca64..653424054 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,11 @@ +2003-01-12 Ezra Peisach + + * svc_auth_gssapi.c (_svcauth_gssapi_unset_names): If invoked more + than once, do not double free memory. + + * clnt_perror.c (clnt_sperror): Do not write past end of allocated + buffer. + 2003-01-10 Ken Raeburn * configure.in: Don't explicitly invoke AC_PROG_ARCHIVE, diff --git a/src/lib/rpc/clnt_perror.c b/src/lib/rpc/clnt_perror.c index 08e8471b1..26aa97883 100644 --- a/src/lib/rpc/clnt_perror.c +++ b/src/lib/rpc/clnt_perror.c @@ -91,7 +91,7 @@ clnt_sperror(rpch, s) strncat (str, ": ", BUFSIZ - 1 - strlen (bufstart)); str += strlen(str); strncat (str, clnt_sperrno(e.re_status), BUFSIZ - 1 - strlen (bufstart)); - str[BUFSIZ - 1] = '\0'; + strstart[BUFSIZ - 1] = '\0'; str += strlen(str); switch (e.re_status) { diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c index cb2844fc3..8458bf473 100644 --- a/src/lib/rpc/svc_auth_gssapi.c +++ b/src/lib/rpc/svc_auth_gssapi.c @@ -968,6 +968,8 @@ void _svcauth_gssapi_unset_names() if (server_creds_list[i]) gss_release_cred(&minor_stat, &server_creds_list[i]); free(server_creds_list); + server_creds_list = NULL; + server_creds_count = 0; } if (server_name_list) { @@ -975,6 +977,8 @@ void _svcauth_gssapi_unset_names() if (server_name_list[i]) gss_release_name(&minor_stat, &server_name_list[i]); free(server_name_list); + server_name_list = NULL; + server_creds_count = 0; } }