X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=spnegokrb5%2Faccept_sec_context.c;h=170f55a4b8611b815e3d8537d8424e4ff47e8b64;hb=38450d1b1c3b07bb12ab7b28d9d32a34b88de0a2;hp=9f76695e0637d048dde2174cb1d137c86cdaae24;hpb=e6161bc2a49ef55c6c781f2c414584c08bf9f266;p=mod_auth_kerb.cvs%2F.git diff --git a/spnegokrb5/accept_sec_context.c b/spnegokrb5/accept_sec_context.c index 9f76695..170f55a 100644 --- a/spnegokrb5/accept_sec_context.c +++ b/spnegokrb5/accept_sec_context.c @@ -64,8 +64,18 @@ code_NegTokenArg(OM_uint32 *minor_status, } } while (ret == ASN1_OVERFLOW); - *outbuf = buf + buf_size - buf_len; + *outbuf = malloc(buf_len); + if (*outbuf == NULL) { + *minor_status = ENOMEM; + free(buf); + return GSS_S_FAILURE; + } + + memcpy(*outbuf, buf + buf_size - buf_len, buf_len); *outbuf_size = buf_len; + + free(buf); + return GSS_S_COMPLETE; } @@ -145,7 +155,7 @@ send_accept (OM_uint32 *minor_status, } ret = code_NegTokenArg (minor_status, &targ, - (unsigned char**) &output_token->value, &output_token->length); + (unsigned char **) &output_token->value, &output_token->length); free_NegTokenTarg(&targ); if (ret) return ret;