mirror of
https://github.com/tmux/tmux.git
synced 2026-10-13 22:34:23 +00:00
Fix off-by-one buffer growth in sixel_print_add
This commit is contained in:
@@ -481,7 +481,7 @@ static void
|
|||||||
sixel_print_add(char **buf, size_t *len, size_t *used, const char *s,
|
sixel_print_add(char **buf, size_t *len, size_t *used, const char *s,
|
||||||
size_t slen)
|
size_t slen)
|
||||||
{
|
{
|
||||||
while (*used + slen >= *len + 1) {
|
while (*used + slen + 1 > *len) {
|
||||||
*buf = xreallocarray(*buf, 2, *len);
|
*buf = xreallocarray(*buf, 2, *len);
|
||||||
(*len) *= 2;
|
(*len) *= 2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user