summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-12-19 00:01:18 +0000
committerThomas Adam <thomas@xteddy.org>2017-12-19 00:01:18 +0000
commit641a885af81c3dd16f72afc2122b8a4945d61e0f (patch)
tree744ee0e7d0c29b72a9b91d0956416f89f389fbe9 /client.c
parent43a1294ed99c301bcbea808384535a37d8fd0066 (diff)
parent62144b9f57ea981ca2c35fe3466945b8234eba64 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'client.c')
-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. */