[PATCH] test-client: initialize input instance.

Kristian Høgsberg hoegsberg at gmail.com
Tue Sep 25 08:13:28 PDT 2012


On Mon, Sep 24, 2012 at 08:07:38PM +0000, Eoff, Ullysses A wrote:
> bump.

Thanks for the reminder, committed.

Kristian

> >-----Original Message-----
> >From: Eoff, Ullysses A
> >Sent: Tuesday, September 04, 2012 2:38 PM
> >To: wayland-devel at lists.freedesktop.org
> >Cc: Eoff, Ullysses A
> >Subject: [PATCH] test-client: initialize input instance.
> >
> >From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>
> >
> >In seat_handle_capabilities, if input->pointer is not properly
> >initialized, then it will contain an arbitrary value and results
> >in the wl_pointer listener not getting registered if that value
> >is not 0/null.  Thus, use calloc to initialize the "input" instance.
> >
> >This fixes https://bugs.freedesktop.org/show_bug.cgi?id=49937
> >
> >Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
> >---
> > tests/test-client.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/tests/test-client.c b/tests/test-client.c
> >index ba084d8..0009a8e 100644
> >--- a/tests/test-client.c
> >+++ b/tests/test-client.c
> >@@ -250,7 +250,7 @@ handle_global(struct wl_display *_display, uint32_t id,
> > 			wl_display_bind(display->display,
> > 					id, &wl_compositor_interface);
> > 	} else if (strcmp(interface, "wl_seat") == 0) {
> >-		input = malloc(sizeof *input);
> >+		input = calloc(1, sizeof *input);
> > 		input->seat = wl_display_bind(display->display, id,
> > 					      &wl_seat_interface);
> > 		input->pointer_focus = NULL;
> >--
> >1.7.11.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list