krb5 commit: Remove unneeded variable enc_tkt_transited
Benjamin Kaduk
kaduk at MIT.EDU
Fri Oct 4 13:23:37 EDT 2013
https://github.com/krb5/krb5/commit/36c8a474bdd05d3f5be94b007dae46f0986adfa2
commit 36c8a474bdd05d3f5be94b007dae46f0986adfa2
Author: Ben Kaduk <kaduk at mit.edu>
Date: Fri Oct 4 12:58:30 2013 -0400
Remove unneeded variable enc_tkt_transited
There's no need to use an intermediate variable to initialize the
contents of enc_tkt_reply.transited.
Instead of setting each field to zero individually (and misspelling NULL),
use memset and set the one field which is being initialized to a nonzero
value explicitly.
src/kdc/do_tgs_req.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c
index 107e2c2..dada375 100644
--- a/src/kdc/do_tgs_req.c
+++ b/src/kdc/do_tgs_req.c
@@ -110,7 +110,6 @@ process_tgs_req(struct server_handle *handle, krb5_data *pkt,
krb5_ticket ticket_reply, *header_ticket = 0;
int st_idx = 0;
krb5_enc_tkt_part enc_tkt_reply;
- krb5_transited enc_tkt_transited;
int newtransited = 0;
krb5_error_code retval = 0;
krb5_keyblock encrypting_key;
@@ -584,12 +583,8 @@ process_tgs_req(struct server_handle *handle, krb5_data *pkt,
errcode = KRB5KDC_ERR_TRTYPE_NOSUPP;
goto cleanup;
}
- enc_tkt_transited.tr_type = KRB5_DOMAIN_X500_COMPRESS;
- enc_tkt_transited.magic = 0;
- enc_tkt_transited.tr_contents.magic = 0;
- enc_tkt_transited.tr_contents.data = 0;
- enc_tkt_transited.tr_contents.length = 0;
- enc_tkt_reply.transited = enc_tkt_transited;
+ memset(&enc_tkt_reply.transited, 0, sizeof(enc_tkt_reply.transited));
+ enc_tkt_reply.transited.tr_type = KRB5_DOMAIN_X500_COMPRESS;
if ((errcode =
add_to_transited(&header_enc_tkt->transited.tr_contents,
&enc_tkt_reply.transited.tr_contents,
More information about the cvs-krb5
mailing list