mirror of
https://github.com/curl/curl.git
synced 2026-08-06 20:16:15 +03:00
sockfilt: fix invalid increment of handles index variable nfd
Only increment the array index if we actually stored a handle.
Follow up to e917492048
Closes #6992
This commit is contained in:
parent
b9239e0f9c
commit
d698c70421
1 changed files with 5 additions and 1 deletions
|
|
@ -725,6 +725,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
handles[nfd] = signal;
|
||||
data[nth].signal = signal;
|
||||
data[nth].thread = handle;
|
||||
nfd++;
|
||||
nth++;
|
||||
}
|
||||
else {
|
||||
|
|
@ -734,9 +735,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
}
|
||||
else if(fd == fileno(stdout)) {
|
||||
handles[nfd] = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
nfd++;
|
||||
}
|
||||
else if(fd == fileno(stderr)) {
|
||||
handles[nfd] = GetStdHandle(STD_ERROR_HANDLE);
|
||||
nfd++;
|
||||
}
|
||||
else {
|
||||
wsaevent = WSACreateEvent();
|
||||
|
|
@ -763,6 +766,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
if(FD_ISSET(wsasock, &exceptsock))
|
||||
data[nfd].wsastate |= FD_OOB;
|
||||
}
|
||||
nfd++;
|
||||
nws++;
|
||||
}
|
||||
else {
|
||||
|
|
@ -775,6 +779,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
handles[nfd] = signal;
|
||||
data[nth].signal = signal;
|
||||
data[nth].thread = handle;
|
||||
nfd++;
|
||||
nth++;
|
||||
}
|
||||
else {
|
||||
|
|
@ -784,7 +789,6 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
|
|||
}
|
||||
}
|
||||
}
|
||||
nfd++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue