[PATCH] server: zero allocated memory after allocating mappings
Alexandre Julliard
julliard at winehq.org
Mon Apr 29 02:27:34 CDT 2019
Jefferson Carpenter <jeffersoncarpenter2 at gmail.com> writes:
> Turns out it's because pe_image_info_t is 88 bytes in size but only 84
> are used for data members, the last 4 bytes unused.
>
> This is a hard problem in general, since padding bytes can occur
> between data members as well as the end of the struct.
>
> Probably the cleanest way to fix the valgrind warning is to alter
> get_mapping_info so that it sets the reply data memberwise, rather
> than as a binary blob.
You can declare the padding member explicitly, like we do for other
similar structures in the server protocol.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list