From 2ba8976f632336128ca2ad907e7e8d9f79c0da10 Mon Sep 17 00:00:00 2001 From: Julien Loir Date: Sun, 25 Jul 2021 14:37:46 +0200 Subject: [PATCH] secur32: Ignore attribute when searching for buffer type. Buffer types in PSecBufferDesc can have an optional attribute. When searching, it must be ignored to ensure the buffer type is found. Signed-off-by: Julien Loir Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/secur32/schannel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 515f01d08a3..eb8106e88c7 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -659,7 +659,8 @@ static int schan_find_sec_buffer_idx(const SecBufferDesc *desc, unsigned int sta for (i = start_idx; i < desc->cBuffers; ++i) { buffer = &desc->pBuffers[i]; - if (buffer->BufferType == buffer_type) return i; + if ((buffer->BufferType | SECBUFFER_ATTRMASK) == (buffer_type | SECBUFFER_ATTRMASK)) + return i; } return -1;