mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Do not try to put more in command message than will fit when sending
(the server will treat as a fatal error). GitHub issue 1200.
This commit is contained in:
parent
58f6456af7
commit
62144b9f57
4
client.c
4
client.c
@ -337,6 +337,10 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
|
||||
size = 0;
|
||||
for (i = 0; i < argc; i++)
|
||||
size += strlen(argv[i]) + 1;
|
||||
if (size > MAX_IMSGSIZE - (sizeof *data)) {
|
||||
fprintf(stderr, "command too long\n");
|
||||
return (1);
|
||||
}
|
||||
data = xmalloc((sizeof *data) + size);
|
||||
|
||||
/* Prepare command for server. */
|
||||
|
Loading…
Reference in New Issue
Block a user