mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
setup_transfer: deal with both sockets being -1
Detected by Coverity; CID 1435559. Follow-up to f8d608f38d
. It would
index the array with -1 if neither index was a socket.
This commit is contained in:
parent
c3d7db4ecb
commit
fe6b78b42d
@ -2021,7 +2021,8 @@ Curl_setup_transfer(
|
|||||||
if(conn->bits.multiplex || conn->httpversion == 20) {
|
if(conn->bits.multiplex || conn->httpversion == 20) {
|
||||||
/* when multiplexing, the read/write sockets need to be the same! */
|
/* when multiplexing, the read/write sockets need to be the same! */
|
||||||
conn->sockfd = sockindex == -1 ?
|
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;
|
conn->writesockfd = conn->sockfd;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user