mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
bad index overflow protection of lws_lookup
context->lws_lookup allocation size is (sizeof(struct libwebsocket *) * context->max_fds). The maximum index is (context->max_fds - 1). context->max_fds is not a valid index.
This commit is contained in:
parent
3b3fa9e208
commit
a936d07dba
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ insert_wsi_socket_into_fds(struct libwebsocket_context *context,
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (wsi->sock > context->max_fds) {
|
||||
if (wsi->sock >= context->max_fds) {
|
||||
lwsl_err("Socket fd %d is too high (%d)\n",
|
||||
wsi->sock, context->max_fds);
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue