mirror of
https://github.com/tmux/tmux.git
synced 2026-10-11 21:14:21 +00:00
Do not allocate when a Kitty payload chunk decodes to no bytes.
This commit is contained in:
@@ -952,6 +952,12 @@ kitty_append(struct kitty_state *ks, const u_char *buf, size_t len)
|
||||
free(copy);
|
||||
if (decoded == NULL)
|
||||
return (-1);
|
||||
|
||||
/* Empty decoded chunks need no allocation. */
|
||||
if (decodedlen == 0) {
|
||||
free(decoded);
|
||||
return (0);
|
||||
}
|
||||
if (decodedlen > IMAGE_SIZE_LIMIT - ks->rawlen) {
|
||||
free(decoded);
|
||||
return (-1);
|
||||
|
||||
Reference in New Issue
Block a user