From c507727ad240b978c6e09e3aa9238080ca9a1c81 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 2 Apr 2018 11:53:56 -0400 Subject: Fix use-after-free with block hotspots --- swaybar/render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'swaybar/render.c') diff --git a/swaybar/render.c b/swaybar/render.c index a5039a2e..a62e1d01 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -153,7 +153,7 @@ static uint32_t render_status_block(cairo_t *cairo, hotspot->width = width; hotspot->height = height; hotspot->callback = block_hotspot_callback; - hotspot->destroy = free; + hotspot->destroy = NULL; hotspot->data = block; wl_list_insert(&output->hotspots, &hotspot->link); @@ -227,9 +227,9 @@ static uint32_t render_status_line_i3bar(cairo_t *cairo, struct swaybar_config *config, struct swaybar_output *output, struct status_line *status, bool focused, double *x, uint32_t width, uint32_t height) { - struct i3bar_block *block; uint32_t max_height = 0; bool edge = true; + struct i3bar_block *block; wl_list_for_each_reverse(block, &status->blocks, link) { uint32_t h = render_status_block(cairo, config, output, block, x, height, focused, edge); @@ -376,6 +376,7 @@ static uint32_t render_workspace_button(cairo_t *cairo, static uint32_t render_to_cairo(cairo_t *cairo, struct swaybar *bar, struct swaybar_output *output) { struct swaybar_config *config = bar->config; + wlr_log(L_DEBUG, "output %p", output); cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE); if (output->focused) { -- cgit v1.2.3-54-g00ecf