Repository navigation
fix(caddy): parse thread and request counts as int - #2722
Merged
Merged
Conversation
dunglas
force-pushed
the
fix/caddy-int-overflow-32bit
branch
from
October 16, 2026 12:22
6ac3398 to
868a6b7
Compare
dunglas
marked this pull request as ready for review
October 16, 2026 12:27
AlliBalliBaba
approved these changes
Oct 16, 2026
AlliBalliBaba
left a comment
Contributor
There was a problem hiding this comment.
Caddy seems to currently generally swallow error messages on startup (probably already fixed here?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
num_threads,max_threads,max_requests, the workernumandmax_threadsoptions, andphp-server --worker file,Nare parsed withstrconv.ParseUint(s, 10, 32)and then converted toint. On 32-bit platforms (we shiplinux/386,linux/arm/v6andlinux/arm/v7images), values between 2^31 and 2^32-1 wrap to negative numbers:max_threads 4294967295becomes-1, which meansauto.These values are now parsed with
strconv.Atoithrough aparseNonNegativeInthelper. Nothing gets converted, so nothing can wrap, and out-of-range input returns a range error on every platform. Negative values are still rejected explicitly, because the runtime treats them as sentinels (auto thread count, default worker count). 64-bit builds accept the same values as before.Reported by CodeQL (
go/incorrect-integer-conversion) while setting it up in #2720.