Juan Lang : crypt32: Add an extra pointer alignment to avoid possible memory corruption.
Alexandre Julliard
julliard at winehq.org
Tue Oct 9 13:37:46 CDT 2007
Module: wine
Branch: master
Commit: 57b13b37d5bcec103fd39152db5adafca97cae0c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=57b13b37d5bcec103fd39152db5adafca97cae0c
Author: Juan Lang <juan.lang at gmail.com>
Date: Mon Oct 8 15:38:35 2007 -0700
crypt32: Add an extra pointer alignment to avoid possible memory corruption.
---
dlls/crypt32/msg.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 15fbbc9..2d19736 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;
}
More information about the wine-cvs
mailing list