Commit b7822050 by Patrick Steinhardt

Merge pull request #3993 from alexcrichton/fix-fault

parents 5fe5557e 5ca75fd5
...@@ -121,6 +121,11 @@ static int curls_connect(git_stream *stream) ...@@ -121,6 +121,11 @@ static int curls_connect(git_stream *stream)
return seterr_curl(s); return seterr_curl(s);
} }
if (sockextr == -1) {
giterr_set(GITERR_NET, "curl socket is no longer valid");
return -1;
}
s->socket = sockextr; s->socket = sockextr;
if (s->parent.encrypted && failed_cert) if (s->parent.encrypted && failed_cert)
...@@ -198,6 +203,7 @@ static int wait_for(curl_socket_t fd, bool reading) ...@@ -198,6 +203,7 @@ static int wait_for(curl_socket_t fd, bool reading)
FD_ZERO(&outfd); FD_ZERO(&outfd);
FD_ZERO(&errfd); FD_ZERO(&errfd);
assert(fd >= 0);
FD_SET(fd, &errfd); FD_SET(fd, &errfd);
if (reading) if (reading)
FD_SET(fd, &infd); FD_SET(fd, &infd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment