pull up r22084 from trunk
authorTom Yu <tlyu@mit.edu>
Mon, 16 Mar 2009 17:58:53 +0000 (17:58 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 16 Mar 2009 17:58:53 +0000 (17:58 +0000)
acc_ctx_new() can return an error condition without establishing a
SPNEGO context structure.  This can cause a null pointer dereference
in cleanup code in spnego_gss_accept_sec_context().

ticket: 6402
version_fixed: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22099 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/spnego/spnego_mech.c

index 5321de0befb46197986fec1e6be49d31efbb4a60..9b8a46e119a1faed5e5f6a2e60fdef9420eef456 100644 (file)
@@ -1650,7 +1650,8 @@ spnego_gss_accept_sec_context(
                                 &negState, &return_token);
        }
 cleanup:
-       if (return_token != NO_TOKEN_SEND && return_token != CHECK_MIC) {
+       if (return_token == INIT_TOKEN_SEND ||
+           return_token == CONT_TOKEN_SEND) {
                /* For acceptor-sends-first send a tokenInit */
                int tmpret;