crypt32: Add an extra pointer alignment to avoid possible memory corruption.

This commit is contained in:
Juan Lang 2007-10-08 15:38:35 -07:00 committed by Alexandre Julliard
parent 4ed3f22082
commit 57b13b37d5
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}