Skip to content

Address review feedback on ULONG_MAX availability in http_server#8433

Closed
Copilot wants to merge 1 commit intointrigus/fix/http-server-overflow-checkfrom
copilot/sub-pr-8391
Closed

Address review feedback on ULONG_MAX availability in http_server#8433
Copilot wants to merge 1 commit intointrigus/fix/http-server-overflow-checkfrom
copilot/sub-pr-8391

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Clarified that ULONG_MAX is already available through the existing include chain and does not require an explicit #include <limits.h> in fd_http_server.c.

Context

The overflow check introduced in the parent PR (#8391) uses ULONG_MAX:

ulong digit = (ulong)(content_length[ i ]-'0');
if( FD_UNLIKELY( content_len>(ULONG_MAX-digit)/10UL ) ) { /* Overflow */
  close_conn( http, conn_idx, FD_HTTP_SERVER_CONNECTION_CLOSE_LARGE_REQUEST );
  return;
}

Resolution

No code changes required. ULONG_MAX is provided via the include chain:

  • fd_http_server.c includes fd_http_server_private.h
  • fd_http_server_private.h includes fd_http_server.h
  • fd_http_server.h includes fd_util_base.h
  • fd_util_base.h includes <limits.h>

Compilation verified successful.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Address feedback on overflow check in http_server implementation Address review feedback on ULONG_MAX availability in http_server Feb 24, 2026
@ripatel-fd ripatel-fd closed this Feb 24, 2026
Copilot AI requested a review from ripatel-fd February 24, 2026 20:24
Copilot stopped work on behalf of ripatel-fd due to an error February 24, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants