[PATCH wayland] Zero out the closure serializing buffer to make valgrind happy.

Jason Ekstrand jason at jlekstrand.net
Sat Jul 13 19:23:53 PDT 2013


*bump*

This one came up on IRC again the other day.
--Jason Ekstrand


On Tue, Apr 9, 2013 at 4:59 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:

> Valgrind complains because sometimes padding at the ends of strings and
> arrays
> is left uninitialized.  Zeroing out the buffer fixes this problem.
>
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/connection.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/connection.c b/src/connection.c
> index 9425ca6..f79b6d0 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -1018,6 +1018,8 @@ wl_closure_send(struct wl_closure *closure, struct
> wl_connection *connection)
>         uint32_t buffer[256];
>         int size;
>
> +       memset(buffer, 0, sizeof buffer);
> +
>         if (copy_fds_to_connection(closure, connection))
>                 return -1;
>
> @@ -1034,6 +1036,8 @@ wl_closure_queue(struct wl_closure *closure, struct
> wl_connection *connection)
>         uint32_t buffer[256];
>         int size;
>
> +       memset(buffer, 0, sizeof buffer);
> +
>         if (copy_fds_to_connection(closure, connection))
>                 return -1;
>
> --
> 1.8.1.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130713/a20c08a2/attachment.html>


More information about the wayland-devel mailing list