1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-10 21:48:10 -05:00

singlesocket: use separate variable for inner loop

An inner loop within the singlesocket() function wrongly re-used the
variable for the outer loop which then could cause an infinite
loop. Change to using a separate variable!

Reported-by: Eric Wu
Fixes #3970
Closes #3973
This commit is contained in:
Daniel Stenberg 2019-05-31 23:00:06 +02:00
parent d3d04a872c
commit c36f42839d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2252,14 +2252,14 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
actions[i] = action;
if(entry) {
/* check if new for this transfer */
for(i = 0; i< data->numsocks; i++) {
if(s == data->sockets[i]) {
prevaction = data->actions[i];
int j;
for(j = 0; j< data->numsocks; j++) {
if(s == data->sockets[j]) {
prevaction = data->actions[j];
sincebefore = TRUE;
break;
}
}
}
else {
/* this is a socket we didn't have before, add it to the hash! */