From 68fa95cfec78f1bfe790949bf747d578ad583ec2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 26 Oct 2008 23:55:38 +0100 Subject: Check of socket name length --- sysdep/unix/io.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdep/unix/io.c') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 7dcca21..fa471f6 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -865,6 +865,10 @@ sk_open_unix(sock *s, char *name) if (err = sk_setup(s)) goto bad; unlink(name); + + if (strlen(name) >= sizeof(sa.sun_path)) + die("sk_open_unix: path too long"); + sa.sun_family = AF_UNIX; strcpy(sa.sun_path, name); if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0) -- cgit v1.2.3