From c09f8fec46803bc14c6c3b3560459891ff993bb9 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 22 Jun 2006 18:36:16 +0000 Subject: [PATCH] Apply (modified) patches from Michael Calmer to fix some warnings * src/lib/gssapi/spnego/spnego_mech.c (get_req_flags): Remove unused var. (get_negTokenResp): Fix signedness bug. (make_spnego_tokenInit_msg): Remove unused vars (make_spnego_tokenTarg_msg): Initialize uninitialized vars. * src/lib/gssapi/spnego/gssapiP_spnego.h: Delete TWRITE_STR. ticket: 3905 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18198 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/spnego/gssapiP_spnego.h | 4 ---- src/lib/gssapi/spnego/spnego_mech.c | 21 ++++++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/lib/gssapi/spnego/gssapiP_spnego.h b/src/lib/gssapi/spnego/gssapiP_spnego.h index 2d3e5e20b..1c8fd7a7b 100644 --- a/src/lib/gssapi/spnego/gssapiP_spnego.h +++ b/src/lib/gssapi/spnego/gssapiP_spnego.h @@ -117,10 +117,6 @@ static const gss_OID_set_desc spnego_oidsets[] = { }; const gss_OID_set_desc * const gss_mech_set_spnego = spnego_oidsets+0; -#define TWRITE_STR(ptr, str, len) \ - memcpy((ptr), (char *)(str), (len)); \ - (ptr) += (len); - #ifdef DEBUG #define dsyslog(a) syslog(LOG_DEBUG, a) #else diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c index ec8b6083a..15f46d56a 100644 --- a/src/lib/gssapi/spnego/spnego_mech.c +++ b/src/lib/gssapi/spnego/spnego_mech.c @@ -1953,7 +1953,6 @@ get_req_flags(unsigned char **buff_in, OM_uint32 bodysize, OM_uint32 *req_flags) { int len; - unsigned char *start = *buff_in; if (**buff_in != (CONTEXT | 0x01)) return (0); @@ -2079,8 +2078,8 @@ get_negTokenResp(OM_uint32 *minor_status, gss_buffer_t *mechListMIC) { unsigned char *ptr, *bufstart; - int len, bytes; - unsigned int tag; + int len; + unsigned int tag, bytes; *negState = ACCEPT_DEFECTIVE_TOKEN; *supportedMech = GSS_C_NO_OID; @@ -2280,11 +2279,8 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, int rspTokenSize = 0; int mechListTokenSize = 0; int micTokenSize = 0; - int i; unsigned char *t; unsigned char *ptr; - unsigned char *MechListPtr = NULL; - gss_buffer_desc MICbuff; if (outbuf == GSS_C_NO_BUFFER) return (-1); @@ -2448,13 +2444,12 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, send_token_flag sendtoken, gss_buffer_t outbuf) { - int tlen; - int ret; - int NegTokenTargSize; - int negresultTokenSize; - int NegTokenSize; - int rspTokenSize; - int micTokenSize; + int tlen = 0; + int ret = 0; + int NegTokenTargSize = 0; + int NegTokenSize = 0; + int rspTokenSize = 0; + int micTokenSize = 0; int dataLen = 0; unsigned char *t; unsigned char *ptr; -- 2.26.2