diff --git a/ChangeLog b/ChangeLog index 08a4dfbdfd..717b8c470e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 27 20:07:52 2003 Nobuyoshi Nakada + + * ext/socket/socket.c (sock_addrinfo): get rid of SEGV at NULL ptr + String. increase buffer size for 64bit platforms. + Mon May 26 21:39:46 2003 MoonWolf * lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 039d7b006b..0198a8e1d6 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -553,7 +553,7 @@ sock_addrinfo(host, port, socktype, flags) struct addrinfo hints, *hintsp, *res; char *hostp, *portp; int error; - char hbuf[1024], pbuf[16]; + char hbuf[1024], pbuf[32]; if (NIL_P(host)) { hostp = NULL; @@ -569,7 +569,7 @@ sock_addrinfo(host, port, socktype, flags) SafeStringValue(host); name = RSTRING(host)->ptr; - if (*name == 0 || (name[0] == '<' && strcmp(name, "") == 0)) { + if (!name || *name == 0 || (name[0] == '<' && strcmp(name, "") == 0)) { mkinetaddr(INADDR_ANY, hbuf, sizeof(hbuf)); } else if (name[0] == '<' && strcmp(name, "") == 0) {