From d3c8b59e027bda8f5eb06c31670db4e017eff500 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 20 Aug 2008 12:03:12 -0700 Subject: [PATCH] crypt32: Pass address of blob to store data rather than message to CDecodeMsg_CopyData. --- dlls/crypt32/msg.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 22d740e2741..be12218bd01 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1518,22 +1518,22 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg) ContextPropertyList_Free(msg->properties); } -static BOOL CDecodeMsg_CopyData(CDecodeMsg *msg, const BYTE *pbData, +static BOOL CDecodeMsg_CopyData(CRYPT_DATA_BLOB *blob, const BYTE *pbData, DWORD cbData) { BOOL ret = TRUE; if (cbData) { - if (msg->msg_data.cbData) - msg->msg_data.pbData = CryptMemRealloc(msg->msg_data.pbData, - msg->msg_data.cbData + cbData); + if (blob->cbData) + blob->pbData = CryptMemRealloc(blob->pbData, + blob->cbData + cbData); else - msg->msg_data.pbData = CryptMemAlloc(cbData); - if (msg->msg_data.pbData) + blob->pbData = CryptMemAlloc(cbData); + if (blob->pbData) { - memcpy(msg->msg_data.pbData + msg->msg_data.cbData, pbData, cbData); - msg->msg_data.cbData += cbData; + memcpy(blob->pbData + blob->cbData, pbData, cbData); + blob->cbData += cbData; } else ret = FALSE; @@ -1768,7 +1768,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, if (msg->base.open_flags & CMSG_DETACHED_FLAG && msg->base.state != MsgStateDataFinalized) { - ret = CDecodeMsg_CopyData(msg, pbData, cbData); + ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData); msg->base.state = MsgStateDataFinalized; if (ret) ret = CDecodeMsg_DecodeContent(msg, &msg->msg_data, @@ -1784,7 +1784,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, } else { - ret = CDecodeMsg_CopyData(msg, pbData, cbData); + ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData); if (msg->base.state == MsgStateInit) msg->base.state = MsgStateUpdated; } @@ -1797,7 +1797,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, { if (msg->base.state == MsgStateInit) { - ret = CDecodeMsg_CopyData(msg, pbData, cbData); + ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData); if (ret) ret = CDecodeMsg_DecodeContent(msg, &msg->msg_data, msg->type);