diff options
author | Mateusz Polrola <mateuszx.potrola@intel.com> | 2016-05-30 10:36:00 +0900 |
---|---|---|
committer | Wataru Natsume <wataru_natsume@xddp.denso.co.jp> | 2016-05-30 10:58:02 +0900 |
commit | eeef98212f9256699f5420cf192d8ba41ee065ed (patch) | |
tree | 11791098a13d90140024365ac84ed9d7d65bd414 /weston-ivi-shell/src | |
parent | 31c759f6d3652b570dd30143a71bfeffa7816fc7 (diff) | |
download | wayland-ivi-extension-eeef98212f9256699f5420cf192d8ba41ee065ed.tar.gz |
ivi-controller: do not iterate over empty list in send_surface_add_event
Iterating over empty list will modify first value passed to
wl_list_for_each, but that won't be valid list entry, which in
case of send_surface_add_even leads to crash.
V2 change:
Use break instead of continue
Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com>
Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
Diffstat (limited to 'weston-ivi-shell/src')
-rw-r--r-- | weston-ivi-shell/src/ivi-controller-impl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c index 8c89904..af79ded 100644 --- a/weston-ivi-shell/src/ivi-controller-impl.c +++ b/weston-ivi-shell/src/ivi-controller-impl.c @@ -165,6 +165,10 @@ send_surface_add_event(struct ivisurface *ivisurf, for (i = 0; i < (int)length; i++) { /* Send new surface event */ ivilayer = NULL; + if (wl_list_empty(&shell->list_layer)) { + break; + } + wl_list_for_each(ivilayer, &shell->list_layer, link) { if (ivilayer->layout_layer == pArray[i]) { break; |