sendf: fix CR detection if no LF is in the chunk#21221
Conversation
When doing line ending conversions, and a chunk contains no '\n', the function returned early without updating prev_cr to reflect the last byte. It could then lead to CRLFs sequences not get converted when occuring right on the boundary border. Found by Codex Security
There was a problem hiding this comment.
Pull request overview
Fixes a boundary-condition bug in the client-side line-ending conversion reader (cr_lc_read) where prev_cr was not updated when a read chunk contained no \n, which could prevent correct CRLF handling across read boundaries.
Changes:
- Update
ctx->prev_crbased on the last byte of the chunk in the “no\nfound” fast path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Analysis of PR #21221 at eb61b214: Test 2089 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them). Note that this CI job has had a number of other flaky tests recently (3, to be exact) so it may be that this failure is rather a systemic issue with this job and not with this specific PR. Generated by Testclutch |
When doing line ending conversions, and a chunk contains no '\n', the function returned early without updating prev_cr to reflect the last byte. It could then lead to CRLFs sequences not get converted when occuring right on the boundary border. Found by Codex Security Closes curl#21221
When doing line ending conversions, and a chunk contains no '\n', the function returned early without updating prev_cr to reflect the last byte. It could then lead to CRLFs sequences not get converted when occuring right on the boundary border.
Found by Codex Security