krb5: Fix crash in resolving "DIR" as a ccache name (Fix #1108)

This commit is contained in:
Nicolas Williams
2023-05-26 13:47:26 -05:00
parent 7812c17f95
commit 39f24c4cd4
2 changed files with 3 additions and 5 deletions

View File

@@ -371,13 +371,11 @@ this is a FILE cache in a file named
(the default would be
.Ql /tmp/krb5cc_{UID} )
.It Ql FILE:/tmp/cc+jane@TEST.H5L.SE
.It Ql DIR:
.It Ql DIR:/tmp/ccdir
this is a FILE cache named by
.Ql /tmp/krb5cc_{UID}_dir/primary
which will be of the form
.Ql /tmp/krb5cc_{UID}_dir/tkt.XXXXXX
.It Ql DIR:/tmp/ccdir
same, but in the givern directory rather than the default
.Ql /tmp/ccdir/tkt.XXXXXX
.It Ql DIR:/tmp/ccdir:jane@TEST.H5L.SE
this is a FILE ccache named
.Ql /tmp/ccdir/tkt.jane@TEST.H5L.SE

View File

@@ -377,7 +377,7 @@ dcc_resolve_2(krb5_context context,
*
*/
if (*res == '\0' || (res[0] == ':' && res[1] == '\0')) {
if (res == NULL || *res == '\0' || (res[0] == ':' && res[1] == '\0')) {
/* XXX Why not? */
krb5_set_error_message(context, KRB5_CC_FORMAT,
N_("\"DIR:\" is not a valid ccache name", ""));