Commit 3c3959cf authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mpr: Use offsetof for the size of structs with varlen arrays.

parent e6f5829a
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment