Repository navigation
Use unsigned bytes in the HTTP parser - #230
Merged
Merged
Conversation
This was referenced Nov 18, 2026
rafaelfranca
force-pushed
the
ci-fixes/parser-bytes
branch
from
November 18, 2026 22:44
bb880db to
2cc7241
Compare
rafaelfranca
marked this pull request as draft
November 18, 2026 22:46
Version 0.18.3 included a parser generated on a platform with unsigned char. On x86-64, that parser can reject request bytes above 0x7f. Master now has parser output generated on x86-64. Ragel still uses the default signedness of char, so its output can differ between platforms. Set the Ragel alphabet and key to unsigned char. Regenerate the parser and add tests for non-ASCII request bytes.
rafaelfranca
force-pushed
the
ci-fixes/parser-bytes
branch
from
November 18, 2026 22:48
2cc7241 to
a30e761
Compare
Member
Author
|
@byroot I think this fixes the issue with the ragel differences between machines |
Contributor
|
Nice find. |
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.
Problem
The parser in 0.18.3 was generated on a platform with unsigned
char.On x86-64 Linux, the compiler uses signed
char.The parser can reject bytes
0x80through0xffin request headers and raw request targets.PR #229 regenerated the C parser on x86-64.
The Ragel output still depends on the platform's default
chartype.Solution
Set the Ragel alphabet and key to
unsigned char.Regenerate the C parser and add tests for non-ASCII request bytes.
Verification
masterafter Regenerate ragel output #229 accepted the tested header and path bytes on ARM64 Linux.