FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Check for -1 after CURLINFO_LASTSOCKET by alexcrichton · Pull Request #3993 · libgit2/libgit2 · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions src/curl_stream.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ static int curls_connect(git_stream *stream)
return seterr_curl(s);
}

if (sockextr == -1) {
giterr_set(GITERR_NET, "curl socket is no longer valid");
return -1;
}

s->socket = sockextr;

if (s->parent.encrypted && failed_cert)
Expand Down Expand Up @@ -198,6 +203,7 @@ static int wait_for(curl_socket_t fd, bool reading)
FD_ZERO(&outfd);
FD_ZERO(&errfd);

assert(fd >= 0);
FD_SET(fd, &errfd);
if (reading)
FD_SET(fd, &infd);
Expand Down

Back | FazBrowse Home | New Git URL