Skip to content

tool: large file range causes OOM error #4393

@SumatraPeter

Description

@SumatraPeter

A parameterized URI with a numeric sequence like curl "https://example.com/file-[1234567890-9876543210].jpg" -o "file-#1.jpg" fails with the following error:

curl: (3) bad range in URL position 38:
https://example.com/file-[1234567890-9876543210].jpg
                                     ^

Reducing the range to curl "https://example.com/file-[123456789-987654321].jpg" -o "file-#1.jpg" resulted in my system hanging for a while, followed by a brief flash of the command prompt window with curl repeatedly spitting out an Out of Memory error, followed by my monitor going blank and the system requiring a hard reset to recover!

  1. Can you use a larger integer data type (at least 4 bytes if not more) for the range start and end values?

  2. Please fix this bug that's making curl go into an infinite loop of OOM error messages and causing my system to hang so badly. If the range is too large then there should be a single error message printed before the program exits gracefully.


curl -V output:

curl 7.66.0 (x86_64-pc-win32) libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.39.2
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP brotli libz

OS: Windows 10 x64 1809 (Build 17763.737)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions