mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
mpr: Use offsetof for the size of structs with varlen arrays.
This commit is contained in:
parent
e6f5829ae1
commit
3c3959cfd3
1 changed files with 2 additions and 2 deletions
|
@ -298,8 +298,8 @@ UINT WINAPI WNetEnumCachedPasswords(
|
|||
continue;
|
||||
|
||||
/* read the value data */
|
||||
size = sizeof *entry - sizeof entry->abResource[0] + val_sz + data_sz;
|
||||
entry = HeapAlloc( GetProcessHeap(), 0, sizeof *entry + val_sz + data_sz );
|
||||
size = offsetof( PASSWORD_CACHE_ENTRY, abResource[val_sz + data_sz] );
|
||||
entry = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
memcpy( entry->abResource, val, val_sz );
|
||||
entry->cbEntry = size;
|
||||
entry->cbResource = val_sz;
|
||||
|
|
Loading…
Reference in a new issue