Unverified Commit fe6b78b4 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

setup_transfer: deal with both sockets being -1

Detected by Coverity; CID 1435559.  Follow-up to f8d608f3. It would
index the array with -1 if neither index was a socket.
parent c3d7db4e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2021,7 +2021,8 @@ Curl_setup_transfer(
  if(conn->bits.multiplex || conn->httpversion == 20) {
    /* when multiplexing, the read/write sockets need to be the same! */
    conn->sockfd = sockindex == -1 ?
      conn->sock[writesockindex] : conn->sock[sockindex];
      ((writesockindex == -1 ? CURL_SOCKET_BAD : conn->sock[writesockindex])) :
      conn->sock[sockindex];
    conn->writesockfd = conn->sockfd;
  }
  else {