Do not create a buffer from an OSC 52 response if we have not sent a

query.
This commit is contained in:
nicm
2022-02-15 13:03:02 +00:00
parent 040164555a
commit f85208602d
4 changed files with 35 additions and 3 deletions

View File

@@ -1217,6 +1217,11 @@ tty_keys_clipboard(__unused struct tty *tty, const char *buf, size_t len,
buf++;
end--;
/* If we did not request this, ignore it. */
if (~tty->flags & TTY_OSC52QUERY)
return (0);
tty->flags &= ~TTY_OSC52QUERY;
/* It has to be a string so copy it. */
copy = xmalloc(end + 1);
memcpy(copy, buf, end);