From f162492cf389d9680ecacfd951921607e0899679 Mon Sep 17 00:00:00 2001 From: nononame Date: Sat, 11 Jan 2014 13:12:34 +0800 Subject: [PATCH] fix lws_lookup off by one Signed-off-by: nononame --- lib/libwebsockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 01dc58ee..18b50099 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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;