mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:23:33 +03:00
urlapi: verify the last letter of a scheme when set explictly
A logic error made the function not check the last character, which thus could make it accept invalid schemes. Added test 1965 to verify Reported-by: Otis Cui Lei Closes #20893
This commit is contained in:
parent
5fc7d50cec
commit
11c14b5ca5
5 changed files with 103 additions and 2 deletions
44
tests/data/test1965
Normal file
44
tests/data/test1965
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
urlapi
|
||||
curl_url_set
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
<client>
|
||||
<name>
|
||||
curl_url_set() different schemes
|
||||
</name>
|
||||
<tool>
|
||||
lib%TESTNUMBER
|
||||
</tool>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<stdout mode="text">
|
||||
bad! REJECTED
|
||||
bad{ REJECTED
|
||||
bad/ REJECTED
|
||||
bad\ REJECTED
|
||||
a! REJECTED
|
||||
a+123 ACCEPTED
|
||||
http-2 ACCEPTED
|
||||
http.1 ACCEPTED
|
||||
a+-.123 ACCEPTED
|
||||
http-+++2 ACCEPTED
|
||||
http.1-- ACCEPTED
|
||||
+a123 REJECTED
|
||||
-http2 REJECTED
|
||||
.http1 REJECTED
|
||||
ABC2 ACCEPTED
|
||||
2CBA REJECTED
|
||||
REJECTED
|
||||
a ACCEPTED
|
||||
aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd ACCEPTED
|
||||
aaaaaaaaaabbbbbbbbbbccccccccccdddddddddde REJECTED
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue