mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 04:27:00 +00:00
Do not leak label if it is too long, GitHub issue 4591.
This commit is contained in:
@ -657,8 +657,10 @@ window_tree_draw_session(struct window_tree_modedata *data, struct session *s,
|
||||
screen_write_preview(ctx, &w->active->base, width, sy);
|
||||
|
||||
xasprintf(&label, " %u:%s ", wl->idx, w->name);
|
||||
if (strlen(label) > width)
|
||||
if (strlen(label) > width) {
|
||||
free(label);
|
||||
xasprintf(&label, " %u ", wl->idx);
|
||||
}
|
||||
window_tree_draw_label(ctx, cx + offset, cy, width, sy, &gc,
|
||||
label);
|
||||
free(label);
|
||||
|
Reference in New Issue
Block a user