Repository navigation
Conversation
- Treat SANITIZE_ERR_INVALID_PATH in the calling function as CURLE_BAD_FUNCTION_ARGUMENT. - Warn in the sanitizer function via warnf with the reason that SANITIZE_ERR_INVALID_PATH is returned. SANITIZE_ERR_ codes are not mapped directly to CURLE_ error codes which may have led to some confusion in certain cases so this change is an attempt to mitigate that. Prior to this change some calling functions returned CURLE_URL_MALFORMAT for SANITIZE_ERR_INVALID_PATH even though the URL was not malformatted. Bug: https://github.com/curl/curl/pull/20113/changes#r2652697794 Reported-by: Viktor Szakats Closes #xxxxx
|
Analysis of PR #20121 at d426ec21: Test ../../tests/http/test_07_upload.py::TestUpload::test_07_70_put_earlydata[h3-limited-body] failed, but it has been 0.9% flaky lately, so it's probably NOT a fault of the PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Test 1604 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 72 different CI jobs (the link just goes to one of them). Generated by Testclutch |
|
I need to rethink this, I can't run the unit test and have warnf failures without doing some tool initialization (otherwise segfault probably due to missing tool_stderr init). It will probably be easier to have a generic path invalid message in the calling function instead of handling individual reasons for the path invalid (which is only path too long, really) edit: revised in most recent push |
df11593 to
8a29954
Compare
|
#20143 sort of renders this PR moot so unless anyone thinks we still need the extra warning (for MS-DOS) I'm going to close it |
|
I think we can close |
|
Closing in favor of #20143 |
…n fails On MS-DOS (OOM and bad filename) and Windows (OOM only). Given the rarity of both platform and error, we make a compromise and return an unrelated libcurl error (43) in case of a bad output filename on MS-DOS. After: ``` $ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt curl: (27) Out of memory $ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt Warning: bad output filename curl: (43) A libcurl function was given a bad argument $ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O curl: (27) Out of memory $ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O curl: bad output filename curl: (43) A libcurl function was given a bad argument ``` Before: ``` $ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/ --output out.txt Warning: bad output glob curl: (27) Out of memory $ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/ --output out.txt Warning: bad output glob curl: (3) URL using bad/illegal format or missing URL $ CURL_FN_SANITIZE_OOM=1 wine curl.exe https://curl.se/index.html --globoff -O curl: Failed to extract a filename from the URL to use for storage curl: (27) Out of memory $ CURL_FN_SANITIZE_BAD=1 wine curl.exe https://curl.se/index.html --globoff -O curl: Failed to extract a filename from the URL to use for storage curl: (3) URL using bad/illegal format or missing URL ``` Ref: #20116 (simpler reboot of) Ref: #20113 #20121 Ref: 40c1748 #20198 Ref: eb7f5b7 #20143 Ref: 8c02407 #20125 Fixes #20044 Closes #20199
Treat SANITIZE_ERR_INVALID_PATH in the calling function as CURLE_BAD_FUNCTION_ARGUMENT.
Warn via warnf with the reason that SANITIZE_ERR_INVALID_PATH is returned.
SANITIZE_ERR_ codes are not mapped directly to CURLE_ error codes which may have led to some confusion in certain cases so this change is an attempt to mitigate that.
Prior to this change some calling functions returned CURLE_URL_MALFORMAT for SANITIZE_ERR_INVALID_PATH even though the URL was not malformatted.
Bug: https://github.com/curl/curl/pull/20113/changes#r2652697794
Reported-by: Viktor Szakats
Closes #xxxxx