From 75d6683d1528102b8764e9ccbcd5dc34f5ac1a2c Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 2 Aug 2006 20:51:50 +0000 Subject: [PATCH] Apply patch from Michael Calmer to fix some uninitialized variables * src/appl/gssftp/ftpd/ftpd.c (auth_data): Initialize stat_maj, accept_maj, acquire_maj. * src/appl/telnet/libtelnet/kerberos5.c (kerberos5_send): Intialize rdata. * src/kdc/do_tgs_req.c (process_tgs_req): Initialize magic and tr_contents.magic. * src/lib/krb5/asn.1/krb5_decode.c (decode_krb5_safe_with_body): Initialize tmpbody.magic. * src/plugins/kdb/db2/libdb2/hash/dbm.c (kdb2_fetch) (kdb2_firstkey, kdb2_nextkey): Initialize dsize. ticket: 3904 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18404 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftpd/ftpd.c | 4 +++- src/appl/telnet/libtelnet/kerberos5.c | 1 + src/kdc/do_tgs_req.c | 2 ++ src/lib/krb5/asn.1/krb5_decode.c | 1 + src/plugins/kdb/db2/libdb2/hash/dbm.c | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index 71744a57f..9a3639b3e 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -2389,7 +2389,9 @@ char *adata; char service_name[MAXHOSTNAMELEN+10]; char **gservice; struct hostent *hp; - + stat_maj = 0; + accept_maj = 0; + acquire_maj = 0; kerror = radix_encode(adata, gout_buf, &length, 1); if (kerror) { diff --git a/src/appl/telnet/libtelnet/kerberos5.c b/src/appl/telnet/libtelnet/kerberos5.c index ab8e04d3c..958a4ce4a 100644 --- a/src/appl/telnet/libtelnet/kerberos5.c +++ b/src/appl/telnet/libtelnet/kerberos5.c @@ -260,6 +260,7 @@ kerberos5_send(ap) if (telnet_krb5_realm != NULL) { krb5_data rdata; + rdata.magic = 0; rdata.length = strlen(telnet_krb5_realm); rdata.data = (char *) malloc(rdata.length + 1); if (rdata.data == NULL) { diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index fd868ff36..7b9e1b573 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -474,6 +474,8 @@ tgt_again: 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; diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 04097b0d1..e5cd4f845 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -526,6 +526,7 @@ krb5_error_code decode_krb5_safe_with_body( setup(); alloc_field(*rep,krb5_safe); clear_field(rep,checksum); + tmpbody.magic = 0; check_apptag(20); { begin_structure(); diff --git a/src/plugins/kdb/db2/libdb2/hash/dbm.c b/src/plugins/kdb/db2/libdb2/hash/dbm.c index 58c9df738..43eaf444a 100644 --- a/src/plugins/kdb/db2/libdb2/hash/dbm.c +++ b/src/plugins/kdb/db2/libdb2/hash/dbm.c @@ -90,6 +90,7 @@ kdb2_fetch(key) if (__cur_db == NULL) { no_open_db(); item.dptr = 0; + item.dsize = 0; return (item); } return (kdb2_dbm_fetch(__cur_db, key)); @@ -103,6 +104,7 @@ kdb2_firstkey() if (__cur_db == NULL) { no_open_db(); item.dptr = 0; + item.dsize = 0; return (item); } return (kdb2_dbm_firstkey(__cur_db)); @@ -117,6 +119,7 @@ kdb2_nextkey(key) if (__cur_db == NULL) { no_open_db(); item.dptr = 0; + item.dsize = 0; return (item); } return (kdb2_dbm_nextkey(__cur_db)); -- 2.26.2