mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-11 06:40:28 +00:00
lwip_select: check for correct 'maxfdp1' parameter range
This commit is contained in:
parent
3107d4a0fa
commit
d73e225519
@ -1381,6 +1381,11 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
|||||||
timeout ? (s32_t)timeout->tv_sec : (s32_t)-1,
|
timeout ? (s32_t)timeout->tv_sec : (s32_t)-1,
|
||||||
timeout ? (s32_t)timeout->tv_usec : (s32_t)-1));
|
timeout ? (s32_t)timeout->tv_usec : (s32_t)-1));
|
||||||
|
|
||||||
|
if ((maxfdp1 < 0) || (maxfdp1 > (FD_SETSIZE + LWIP_SOCKET_OFFSET))) {
|
||||||
|
set_errno(EINVAL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Go through each socket in each list to count number of sockets which
|
/* Go through each socket in each list to count number of sockets which
|
||||||
currently match */
|
currently match */
|
||||||
nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset);
|
nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user