* svc_auth_gssapi.c (_svcauth_gssapi_unset_names): If invoked more
authorEzra Peisach <epeisach@mit.edu>
Sun, 12 Jan 2003 17:36:53 +0000 (17:36 +0000)
committerEzra Peisach <epeisach@mit.edu>
Sun, 12 Jan 2003 17:36:53 +0000 (17:36 +0000)
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

src/lib/rpc/ChangeLog
src/lib/rpc/clnt_perror.c
src/lib/rpc/svc_auth_gssapi.c

index 4b8e7ca645ad8fd0562d7c567dd5657dacbd9344..6534240549acd6c8a9c45e7a54c8f46ea9f0c943 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-12  Ezra Peisach  <epeisach@bu.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * configure.in: Don't explicitly invoke AC_PROG_ARCHIVE,
index 08e8471b1eadd63edd7a312a6192a595adb553e5..26aa97883f82c57750b3509747dc8762c95c3fb4 100644 (file)
@@ -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) {
index cb2844fc3a0fa79aa10641b35189134084158073..8458bf4733d5d37e17568a489158a23e704886c2 100644 (file)
@@ -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;
      }
 }