sunos: fix uv_getaddrinfo() NULL pointer dereference

This commit is contained in:
Ben Noordhuis 2012-11-29 23:24:25 +01:00
parent 5639b2f1f9
commit deb1c34774

View File

@ -291,7 +291,12 @@ static int uv_getaddrinfo_done(eio_req* req_) {
uv_getaddrinfo_t* req = req_->data;
struct addrinfo *res = req->res;
#if __sun
size_t hostlen = strlen(req->hostname);
size_t hostlen;
if (req->hostname)
hostlen = strlen(req->hostname);
else
hostlen = 0;
#endif
req->res = NULL;