summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-10-26 23:55:38 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-10-26 23:55:38 +0100
commit68fa95cfec78f1bfe790949bf747d578ad583ec2 (patch)
treed46589a057106fcc9d249705dbcf909395e8bb49 /client
parent52586ccdf17cd9f34f767718d97f8a258da5efdb (diff)
downloadbird-68fa95cfec78f1bfe790949bf747d578ad583ec2.tar
bird-68fa95cfec78f1bfe790949bf747d578ad583ec2.zip
Check of socket name length
Diffstat (limited to 'client')
-rw-r--r--client/client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/client/client.c b/client/client.c
index d65ea06..e3f539e 100644
--- a/client/client.c
+++ b/client/client.c
@@ -252,6 +252,10 @@ server_connect(void)
server_fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (server_fd < 0)
die("Cannot create socket: %m");
+
+ if (strlen(server_path) >= sizeof(sa.sun_path))
+ die("server_connect: path too long");
+
bzero(&sa, sizeof(sa));
sa.sun_family = AF_UNIX;
strcpy(sa.sun_path, server_path);