mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/socket.c (sock_addrinfo): get rid of SEGV at NULL ptr
String. increase buffer size for 64bit platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7712407048
commit
aa37cc7127
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue May 27 20:07:52 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* 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 <moonwolf@moonwolf.com>
|
Mon May 26 21:39:46 2003 MoonWolf <moonwolf@moonwolf.com>
|
||||||
|
|
||||||
* lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block
|
* lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block
|
||||||
|
|
|
@ -553,7 +553,7 @@ sock_addrinfo(host, port, socktype, flags)
|
||||||
struct addrinfo hints, *hintsp, *res;
|
struct addrinfo hints, *hintsp, *res;
|
||||||
char *hostp, *portp;
|
char *hostp, *portp;
|
||||||
int error;
|
int error;
|
||||||
char hbuf[1024], pbuf[16];
|
char hbuf[1024], pbuf[32];
|
||||||
|
|
||||||
if (NIL_P(host)) {
|
if (NIL_P(host)) {
|
||||||
hostp = NULL;
|
hostp = NULL;
|
||||||
|
@ -569,7 +569,7 @@ sock_addrinfo(host, port, socktype, flags)
|
||||||
|
|
||||||
SafeStringValue(host);
|
SafeStringValue(host);
|
||||||
name = RSTRING(host)->ptr;
|
name = RSTRING(host)->ptr;
|
||||||
if (*name == 0 || (name[0] == '<' && strcmp(name, "<any>") == 0)) {
|
if (!name || *name == 0 || (name[0] == '<' && strcmp(name, "<any>") == 0)) {
|
||||||
mkinetaddr(INADDR_ANY, hbuf, sizeof(hbuf));
|
mkinetaddr(INADDR_ANY, hbuf, sizeof(hbuf));
|
||||||
}
|
}
|
||||||
else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
|
else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue