From 7bf267624d3562743e9e020c421b9f29f8cdb62f Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 28 Dec 2008 22:21:35 +0100 Subject: [PATCH] secur32: Try an EMPTY buffer if we can't find one of type TOKEN. --- dlls/secur32/schannel.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 5ba4dfc124..1c99c84064 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -607,9 +607,15 @@ static int schan_init_sec_ctx_get_next_buffer(const struct schan_transport *t, s if (s->current_buffer_idx == -1) { int idx = schan_find_sec_buffer_idx(s->desc, 0, SECBUFFER_TOKEN); - if (idx != -1 && !s->desc->pBuffers[idx].pvBuffer - && (t->ctx->req_ctx_attr & ISC_REQ_ALLOCATE_MEMORY)) - s->allow_buffer_resize = TRUE; + if (t->ctx->req_ctx_attr & ISC_REQ_ALLOCATE_MEMORY) + { + if (idx == -1) + { + idx = schan_find_sec_buffer_idx(s->desc, 0, SECBUFFER_EMPTY); + if (idx != -1) s->desc->pBuffers[idx].BufferType = SECBUFFER_TOKEN; + } + if (idx != -1 && !s->desc->pBuffers[idx].pvBuffer) s->allow_buffer_resize = TRUE; + } return idx; }