mirror of
https://github.com/curl/curl.git
synced 2026-07-24 18:57:18 +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
|
|
@ -1649,6 +1649,7 @@ static CURLUcode set_url_scheme(CURLU *u, const char *scheme,
|
|||
const char *s = scheme;
|
||||
if(ISALPHA(*s)) {
|
||||
/* ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */
|
||||
s++;
|
||||
while(--plen) {
|
||||
if(ISALNUM(*s) || (*s == '+') || (*s == '-') || (*s == '.'))
|
||||
s++; /* fine */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue