[PATCH] server: zero allocated memory after allocating mappings

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Sun Apr 28 23:04:24 CDT 2019


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.

On Sun, Apr 28, 2019 at 7:44 PM Alexandre Julliard <julliard at winehq.org> wrote:
>
> Jefferson Carpenter <jeffersoncarpenter2 at gmail.com> writes:
>
> > From 12fe924328dd2317741db9db28cb9a2ad03a8692 Mon Sep 17 00:00:00 2001
> > From: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
> > Date: Sat, 27 Apr 2019 07:33:59 +0000
> > Subject: [PATCH] server: zero allocated memory after allocating mappings
> >
> > An uninitialized read occurs in the send_reply function, after
> > get_mapping_info calls set_reply_data( &mapping->image, &c..
>
> Please try to figure out which field is not initialized and set it to a
> correct value, instead of hiding the problem by zeroing everything.
>
> --
> Alexandre Julliard
> julliard at winehq.org



More information about the wine-devel mailing list