Reject malformed RESP framing consistently - #317
Conversation
|
@byroot Thanks for taking a look. Could you share what led to closing this PR—was the behavior considered invalid, the patch too broad, or is the parser expected to handle it elsewhere? The reproduced issue is that malformed RESP integer/length fields, invalid CRLF/null frames, negative lengths, and short verbatim frames can be accepted or misparsed, sometimes leaking low-level conversion errors instead of a consistent RESP syntax error. The patch validates those framing boundaries and normalizes conversion failures. The focused parser suite covered 24 cases / 61 assertions, including nine malformed-frame reproductions, without a material benchmark regression. If the concern was scope or missing in-repository coverage, I’m happy to narrow the change and add focused upstream regression tests. |
Validate integer and length framing, reject invalid negative lengths, require CRLF for fixed-length and null frames, validate verbatim strings, and normalize conversion failures to RESP syntax errors.
Verification: focused RESP suite 24 cases / 61 assertions; nine malformed-frame reproductions now fail consistently; parser benchmark showed no material regression; Ruby 4.0.6 syntax, RuboCop, and gem build pass. Source-only patch; no tests included.