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