summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 00:32:05 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 00:32:05 +0000
commita1ed445b812d8aa335700c0bda5e3bd70cc33d20 (patch)
tree31dc641d95d4fa2e19a926644fd9de8a55ce9405 /ext/socket/socket.c
parent616f2c43c6e3693957cbecfbfbf9134163c88ef8 (diff)
* ext/socket/socket.c (sock_s_pack_sockaddr_un): calculate the
correct address length of an abstract socket. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 09c22d6..6900dbc 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1430,7 +1430,7 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
(size_t)RSTRING_LEN(path), sizeof(sockaddr.sun_path));
}
memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
- addr = rb_str_new((char*)&sockaddr, sizeof(sockaddr));
+ addr = rb_str_new((char*)&sockaddr, rsock_unix_sockaddr_len(path));
OBJ_INFECT(addr, path);
return addr;