Hans Leidekker (@hans) commented about dlls/kerberos/krb5_ap.c:
} if ((idx = get_buffer_index( output, SECBUFFER_TOKEN )) == -1) return SEC_E_INVALID_TOKEN;
if (context_req & ISC_REQ_ALLOCATE_MEMORY)
{
output->pBuffers[idx].pvBuffer = RtlAllocateHeap( GetProcessHeap(), 0, KERBEROS_MAX_BUF );
output->pBuffers[idx].cbBuffer = KERBEROS_MAX_BUF;
}
Can you add a check for allocation failure? We should should probably return ISC_RET_ALLOCATED_MEMORY in context_attr when ISC_REQ_ALLOCATE_MEMORY was passed.