kumquat-buildroot/package/weston/weston-0000-safe-foreach.patch
Yann E. MORIN 8dd771bda7 package/weston: bump version
Bump to the recently -released 1.5.0.

Remove existing patches, they are no longer needed:
  - weston-0000-compositor-rpi-fix-input-initialization.patch was a
    back-port of an upstream fix, so no longer needed,
  - weston-0003-dont-build-tests.patch no longer applies due to a
    complete rewrite of Makefile.am, but it seems tests now build fine
    even without EGL support: there is code in the Makefile.am to
    explicitly handle that case

Add a new patch from upstream to avoid a use-after-free situation.

So, it's no longer needed to autoreconf.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-02 13:09:07 +02:00

37 lines
1.2 KiB
Diff

commit a35d028d66cdd83a4a08663231dd2504f1b228f9
Author: U. Artie Eoff <ullysses.a.eoff@intel.com>
Date: Wed May 21 09:20:02 2014 -0700
comp-wayland: use safe foreach when destroying outputs
wl_list_for_each dereference's output to increment the
next iteration of the loop. However, output is free'd
inside the loop resulting in a dereference to free'd
memory.
Use wl_list_for_each_safe instead, which is designed to
handle this kind of pattern.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index a08b71a..76e5396 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -1997,9 +1997,9 @@ err_free:
static void
wayland_compositor_destroy(struct wayland_compositor *c)
{
- struct weston_output *output;
+ struct weston_output *output, *next;
- wl_list_for_each(output, &c->base.output_list, link)
+ wl_list_for_each_safe(output, next, &c->base.output_list, link)
wayland_output_destroy(output);
c->base.renderer->destroy(&c->base);