1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/socket.c (sock_s_getnameinfo): Save errno for EAI_SYSTEM.

Reported by Saravana kumar.  [ruby-core:61820] [Bug #9697]
  Fixed by Heesob Park.  [ruby-core:61868]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-04-07 12:14:29 +00:00
parent fc3b4d06ca
commit 1aa54bebaf
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Mon Apr 7 21:11:49 2014 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (sock_s_getnameinfo): Save errno for EAI_SYSTEM.
Reported by Saravana kumar. [ruby-core:61820] [Bug #9697]
Fixed by Heesob Park. [ruby-core:61868]
Mon Apr 7 07:20:23 2014 NARUSE, Yui <naruse@ruby-lang.org>
* lib/xmlrpc/client.rb (do_rpc): don't check body length.

View file

@ -1346,7 +1346,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
int fl;
struct rb_addrinfo *res = NULL;
struct addrinfo hints, *r;
int error;
int error, saved_errno;
union_sockaddr ss;
struct sockaddr *sap;
socklen_t salen;
@ -1460,11 +1460,15 @@ sock_s_getnameinfo(int argc, VALUE *argv)
return rb_assoc_new(rb_str_new2(hbuf), rb_str_new2(pbuf));
error_exit_addr:
saved_errno = errno;
if (res) rb_freeaddrinfo(res);
errno = saved_errno;
rsock_raise_socket_error("getaddrinfo", error);
error_exit_name:
saved_errno = errno;
if (res) rb_freeaddrinfo(res);
errno = saved_errno;
rsock_raise_socket_error("getnameinfo", error);
UNREACHABLE;