From 57b13b37d5bcec103fd39152db5adafca97cae0c Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 8 Oct 2007 15:38:35 -0700 Subject: [PATCH] crypt32: Add an extra pointer alignment to avoid possible memory corruption. --- dlls/crypt32/msg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 15fbbc92766..2d19736dec2 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1800,6 +1800,9 @@ static DWORD CRYPT_SizeOfAttributes(const CRYPT_ATTRIBUTES *attr) for (j = 0; j < attr->rgAttr[i].cValue; j++) size += attr->rgAttr[i].rgValue[j].cbData; } + /* align pointer again to be conservative */ + if (size % sizeof(DWORD_PTR)) + size += size % sizeof(DWORD_PTR); return size; }