summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-05-31 23:00:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-05-31 23:00:06 +0200
commitf069aab35ce2d6ffb81b322dd23ebc4a1d35ca85 (patch)
tree2cab3a815959e11b2038383996310767fd1be854
parent1c0e9527bad814f81dfbaf54eabdcb9e6fa95586 (diff)
downloadcurl-bagder/singlesocket-loop.tar.gz
singlesocket: use separate variable for inner loopbagder/singlesocket-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
-rw-r--r--lib/multi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/multi.c b/lib/multi.c
index ec0318735..02f846033 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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! */