aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/client.c b/client.c
index 0642bdc4..a51ca464 100644
--- a/client.c
+++ b/client.c
@@ -338,6 +338,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. */