Repository navigation
Conversation
vszakats
reviewed
Oct 21, 2026
| FTP retrieve with an invalid byte-range | ||
| </name> | ||
| <command> | ||
| -r 5-3 ftp://%HOSTIP:%FTPPORT/%TESTNUMBER |
Member
There was a problem hiding this comment.
Is there perhaps an existing test case where this one fits in addition?
The CURLE_RANGE_ERROR returned by Curl_range() for a download was only used to skip setting up the RETR, and was then overwritten by the result of ftp_statemach(). So an invalid range such as -r 5-3 made curl exit with 0 without transferring anything, while file:// returns 33 for the same range. The upload branch already returns the error. Test 1449, whose range is also invalid, now expects 33.
Marti2203
force-pushed
the
ftp-range-error
branch
from
October 21, 2026 13:49
63b50f8 to
ed34dc4
Compare
Contributor
Author
|
Thanks, it turns out test 1449 already covers it: its range is invalid too, and with this change it expects 33 (it exits 0 without the fix). So I dropped test 377 and kept only the test 1449 update. |
bagder
approved these changes
Oct 21, 2026
Member
|
Thanks! |
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.
An invalid range on an FTP download is silently ignored:
curl -r 5-3 ftp://host/file -o outexits 0 without transferring anything, whilefile://returns 33 (CURLE_RANGE_ERROR) for the same range.In
ftp_do_more(), the error fromCurl_range()only skips setting up the RETR, and is then overwritten by the result offtp_statemach(). The upload branch just above already returns it, so this does the same for downloads.Test 1449 (range with an integer overflow) has an invalid range, so it now expects 33, and no QUIT; it fails without the fix.
This issue was found by an LLM-Enhanced Static Analysis Engine and verified manually.