Change #254734
| Category | curl |
| Changed by | Viktor Szakats <commit@vsz.me> |
| Changed at | Sat 10 Jan 2026 13:21:27 |
| Repository | https://github.com/curl/curl.git |
| Project | curl |
| Branch | master |
| Revision | 2465f7c61da0beea79707449dd712ad6edbc38d0 |
Comments
tool: improve error/warning messages when output filename sanitization 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: 40c1748af503cf54443e17db5f537b548faa9328 #20198 Ref: eb7f5b71e5b3fe1e73f6065c78ad0143ff580916 #20143 Ref: 8c02407bef55baaee8d721a7e5f7f0ba8d91dd47 #20125 Fixes #20044 Closes #20199
Changed files
- src/tool_doswin.c
- src/tool_doswin.h
- src/tool_operate.c
- src/tool_operhlp.c
- src/tool_operhlp.h
- src/tool_sdecls.h
- src/tool_urlglob.c
- src/tool_urlglob.h