tool_urlglob: avoid overflow at end of range

Due to how the range span globbing code works, a range that ends with
9223372036854775807 (the maximum signed 63 bit value) cannot be used as
it triggers an integer overflow.

Verified in test 2092

Reported-by: Andrew Nesbit
Closes #21529
This commit is contained in:
Daniel Stenberg 2026-05-07 17:45:48 +02:00
parent 9249aad4c2
commit 3ce10063f1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 33 additions and 3 deletions

28
tests/data/test2092 Normal file
View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
globbing
</keywords>
</info>
# Client-side
<client>
<server>
http
</server>
<name>
glob range that ends with 9223372036854775807
</name>
<command>
"%HOSTIP:%HTTPPORT/[0-1][9223372036854775806-9223372036854775807]/%TESTNUMBER"
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<errorcode>
3
</errorcode>
</verify>
</testcase>