Subject: | Bug in gss_krb5_ccache_name |
From: | Ben Cox <cox-work@djehuti.com> |
To: | krb5-bugs@mit.edu |
Cc: | cox-work@djehuti.com |
Date: | 31 Oct 2002 13:01:38 -0500 |
Hello,
The attached unified diff against the krb5-1.2.6 source tree fixes a bug
in gss_krb5_ccache_name returns a string that has been freed.
The gss_krb5_ccache_name function has an "out_name" parameter that is
supposed to give the old value of the default ccache name.
Unfortunately, before control returns to the caller,
gss_krb5_ccache_name calls krb5_cc_set_default_name, which frees the
buffer that has just been pointed to by *out_name.
The attached patch fixes gss_krb5_ccache_name to strdup the string
before returning (and return GSS_S_FAILURE if the strdup fails). It
also fixes the only caller of gss_krb5_ccache_name (that I could find in
the source tree), which was strdup'ing the result, not to strdup it
anymore.
Thanks,
-- Ben Cox
The attached unified diff against the krb5-1.2.6 source tree fixes a bug
in gss_krb5_ccache_name returns a string that has been freed.
The gss_krb5_ccache_name function has an "out_name" parameter that is
supposed to give the old value of the default ccache name.
Unfortunately, before control returns to the caller,
gss_krb5_ccache_name calls krb5_cc_set_default_name, which frees the
buffer that has just been pointed to by *out_name.
The attached patch fixes gss_krb5_ccache_name to strdup the string
before returning (and return GSS_S_FAILURE if the strdup fails). It
also fixes the only caller of gss_krb5_ccache_name (that I could find in
the source tree), which was strdup'ing the result, not to strdup it
anymore.
Thanks,
-- Ben Cox
Message body is not shown because sender requested not to inline it.