mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
net_gethostbyname_nonblock(): don't crash if net_gethosterror() returns
error message as NULL. Initialize winsock with win32. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@966 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
4316840890
commit
346808789c
2 changed files with 20 additions and 3 deletions
|
|
@ -103,11 +103,11 @@ int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe)
|
|||
errorstr = NULL;
|
||||
} else {
|
||||
errorstr = net_gethosterror(rec.error);
|
||||
rec.errlen = strlen(errorstr)+1;
|
||||
rec.errlen = errorstr == NULL ? 0 : strlen(errorstr)+1;
|
||||
}
|
||||
|
||||
g_io_channel_write_block(pipe, &rec, sizeof(rec));
|
||||
if (rec.error != 0)
|
||||
if (rec.errlen != 0)
|
||||
g_io_channel_write_block(pipe, (void *) errorstr, rec.errlen);
|
||||
|
||||
#ifndef WIN32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue