diff options
author | nicm <nicm> | 2017-12-18 22:13:36 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-12-18 22:13:36 +0000 |
commit | 62144b9f57ea981ca2c35fe3466945b8234eba64 (patch) | |
tree | f2df7cd3d76fb80bd049d92a22f7436f3422547e /client.c | |
parent | 58f6456af7a49db69cf84f538e03c4161a1188d6 (diff) |
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.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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. */ |