From a7c7ab2eb06568409b09132f38b60753bd9304f0 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 7 Aug 2008 16:23:43 +0200 Subject: [PATCH] ewmh: check tags tab size Signed-off-by: Julien Danjou --- ewmh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ewmh.c b/ewmh.c index 17bb886b6..54607342f 100644 --- a/ewmh.c +++ b/ewmh.c @@ -175,7 +175,8 @@ ewmh_update_net_current_desktop(int phys_screen) uint32_t count = 0; tag_t **curtags = tags_get_current(phys_screen); - for(count = 0; tags->tab[count] != curtags[0]; count++); + while(count < (uint32_t) tags->len && tags->tab[count] != curtags[0]) + count++; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, xutil_screen_get(globalconf.connection, phys_screen)->root,