Detected by Coverity; CID
1435559. Follow-up to
f8d608f38d00. It would
index the array with -1 if neither index was a socket.
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 {