Apply (modified) patches from Michael Calmer to fix some warnings
authorTom Yu <tlyu@mit.edu>
Thu, 22 Jun 2006 18:36:16 +0000 (18:36 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 22 Jun 2006 18:36:16 +0000 (18:36 +0000)
* 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
src/lib/gssapi/spnego/spnego_mech.c

index 2d3e5e20b39d360ef2a45ae28860ab50e6d4524f..1c8fd7a7b5e5f7ed597dd741c662fe9a78b7e0de 100644 (file)
@@ -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
index ec8b6083a95e375a283ea5614b7a997fb649a69c..15f46d56a0781165b558320ae3d57cfab882d41a 100644 (file)
@@ -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;