From 9ec3d325048ab72c6f6e037820e33aa8538b7b51 Mon Sep 17 00:00:00 2001 From: Jeffrey Hutzelman Date: Sat, 16 Feb 2013 23:02:36 -0500 Subject: Don't try to checksum with NULL creds If we have no Kerberos credentials, we cannot create a checksum. This can happen if, for example, we end up with an expired TGT. In this case, instead of crashing, just leave the zero checksum. This fixes #80 --- lib/ZMkAuth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c index 8989481..8d7ea0c 100644 --- a/lib/ZMkAuth.c +++ b/lib/ZMkAuth.c @@ -123,7 +123,7 @@ ZMakeZcodeRealmAuthentication(register ZNotice_t *notice, krb5_auth_context authctx; krb5_data *authent; char *cksum_start, *cstart, *cend; - int cksum_len, zcode_len = 0, phdr_adj; + int cksum_len, zcode_len = 0, phdr_adj = 0; notice->z_ascii_authent = NULL; @@ -167,7 +167,7 @@ ZMakeZcodeRealmAuthentication(register ZNotice_t *notice, result = Z_NewFormatRawHeader(notice, buffer, buffer_len, phdr_len, &cksum_start, &cksum_len, &cstart, &cend); notice->z_authent_len = 0; - if (!result) + if (!result && creds != NULL) result = Z_InsertZcodeChecksum(keyblock, notice, buffer, cksum_start, cksum_len, cstart, cend, buffer_len, &phdr_adj, 0); -- cgit v1.2.3