mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Return early if image is zero height when generating fallback, otherwise we can
allocated too little space. Reported by Vivek Parikh.
This commit is contained in:
5
image.c
5
image.c
@@ -84,6 +84,11 @@ image_fallback(char **ret, u_int sx, u_int sy)
|
|||||||
char *buf, *label;
|
char *buf, *label;
|
||||||
u_int py, size, lsize;
|
u_int py, size, lsize;
|
||||||
|
|
||||||
|
if (sy == 0) {
|
||||||
|
*ret = xstrdup("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate first line. */
|
/* Allocate first line. */
|
||||||
lsize = xasprintf(&label, "SIXEL IMAGE (%ux%u)\r\n", sx, sy) + 1;
|
lsize = xasprintf(&label, "SIXEL IMAGE (%ux%u)\r\n", sx, sy) + 1;
|
||||||
if (sx < lsize - 3)
|
if (sx < lsize - 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user