fix some compiler warnings
authorKen Raeburn <raeburn@mit.edu>
Mon, 1 Jul 2002 20:45:39 +0000 (20:45 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 1 Jul 2002 20:45:39 +0000 (20:45 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14591 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/k5unseal.c

index 96e3ad6cc302d1a9c3460fdb4e8174e274f57842..a7982c63475f9e4e74ae21dabb50e9809ba72dec 100644 (file)
@@ -1,3 +1,12 @@
+2002-07-01  Ken Raeburn  <raeburn@mit.edu>
+
+       * accept_sec_context.c (rd_and_store_for_creds): Extra parens
+       around assignments to quiet gcc.
+       (krb5_gss_accept_sec_context): Fix some type mismatches between
+       OM_uint32 and krb5_error_code.
+       * k5unseal.c (kg_unseal_v1): Move a variable declaration and
+       assignment to fix gcc "possibly uninitialized" warning.
+
 2002-03-03  Sam Hartman  <hartmans@mit.edu>
 
        * accept_sec_context.c (rd_and_store_for_creds): Patch from Steven
index 08f90e8e17fecb04738f83829cf6053cea5ec36f..d65c0537995c06c1769cbadcd540fbbaf3d3050e 100644 (file)
@@ -93,7 +93,7 @@ rd_and_store_for_creds(context, auth_context, inbuf, out_cred)
     krb5_auth_context new_auth_ctx = NULL;
        krb5_int32 flags_org;
 
-       if (retval = krb5_auth_con_getflags(context, auth_context, &flags_org))
+       if ((retval = krb5_auth_con_getflags(context, auth_context, &flags_org)))
                return retval;
        krb5_auth_con_setflags(context, auth_context,
                               KRB5_AUTH_CONTEXT_DO_SEQUENCE);
@@ -120,10 +120,10 @@ rd_and_store_for_creds(context, auth_context, inbuf, out_cred)
         * containing the KRB_CRED message does get encrypted.)
         */
        if (krb5_rd_cred(context, auth_context, inbuf, &creds, NULL)) {
-               if (retval = krb5_auth_con_init(context, &new_auth_ctx))
+               if ((retval = krb5_auth_con_init(context, &new_auth_ctx)))
                        goto cleanup;
                krb5_auth_con_setflags(context, new_auth_ctx, 0);
-               if (retval = krb5_rd_cred(context, new_auth_ctx, inbuf, &creds, NULL))
+               if ((retval = krb5_rd_cred(context, new_auth_ctx, inbuf, &creds, NULL)))
                        goto cleanup;
                }
 
@@ -277,19 +277,23 @@ krb5_gss_accept_sec_context(minor_status, context_handle,
 
    /* handle default cred handle */
    if (verifier_cred_handle == GSS_C_NO_CREDENTIAL) {
-       major_status = krb5_gss_acquire_cred(&code, GSS_C_NO_NAME,
+       major_status = krb5_gss_acquire_cred(minor_status, GSS_C_NO_NAME,
                                            GSS_C_INDEFINITE, GSS_C_NO_OID_SET,
                                            GSS_C_ACCEPT, &cred_handle,
                                            NULL, NULL);
-       if (major_status != GSS_S_COMPLETE)
+       if (major_status != GSS_S_COMPLETE) {
+          code = *minor_status;
           goto fail;
+       }
    } else {
        cred_handle = verifier_cred_handle;
    }
 
-   major_status = krb5_gss_validate_cred(&code, verifier_cred_handle);
-   if (GSS_ERROR(major_status))
+   major_status = krb5_gss_validate_cred(minor_status, verifier_cred_handle);
+   if (GSS_ERROR(major_status)) {
+       code = *minor_status;
        goto fail;
+   }
 
    cred = (krb5_gss_cred_id_t) cred_handle;
 
index ebc8a760fe2a13f2237d4ea9489515fd93f63893..40521537919db0e43daff1a9ad607ff02d67028d 100644 (file)
@@ -70,7 +70,6 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
     int toktype;
 {
     krb5_error_code code;
-    int tmsglen;
     int conflen = 0;
     int signalg;
     int sealalg;
@@ -154,9 +153,6 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
        return GSS_S_DEFECTIVE_TOKEN;
     }
 
-    if (toktype == KG_TOK_SEAL_MSG)
-       tmsglen = bodysize-(14+cksum_len);
-
     /* get the token parameters */
 
     if ((code = kg_get_seq_num(context, ctx->seq, ptr+14, ptr+6, &direction,
@@ -168,6 +164,7 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
     /* decode the message, if SEAL */
 
     if (toktype == KG_TOK_SEAL_MSG) {
+       int tmsglen = bodysize-(14+cksum_len);
        if (sealalg != 0xffff) {
            if ((plain = (unsigned char *) xmalloc(tmsglen)) == NULL) {
                *minor_status = ENOMEM;