mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
path in sockaddr_un, really. reported by nagachika. http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e01d836df
commit
da12c793c4
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Apr 27 07:15:07 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
|
||||
path in sockaddr_un, really.
|
||||
reported by nagachika.
|
||||
http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476
|
||||
|
||||
Thu Apr 26 12:28:06 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/raddrinfo.c (init_unix_addrinfo): support the longest
|
||||
|
|
|
@ -1426,7 +1426,7 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
|
|||
StringValue(path);
|
||||
MEMZERO(&sockaddr, struct sockaddr_un, 1);
|
||||
sockaddr.sun_family = AF_UNIX;
|
||||
if (sizeof(sockaddr.sun_path) <= (size_t)RSTRING_LEN(path)) {
|
||||
if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
|
||||
rb_raise(rb_eArgError, "too long unix socket path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
|
||||
(size_t)RSTRING_LEN(path), sizeof(sockaddr.sun_path));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue