mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:03:38 +03:00
Jean Jacques Drouin pointed out that you could only have a user name or
password of 127 bytes or less embedded in a URL, where actually the code uses a 255 byte buffer for it! Modified now to use the full buffer size.
This commit is contained in:
parent
fea5ddf585
commit
6dbfce1031
3 changed files with 15 additions and 4 deletions
|
|
@ -3166,12 +3166,13 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
|
||||
if(*userpass != ':') {
|
||||
/* the name is given, get user+password */
|
||||
sscanf(userpass, "%127[^:@]:%127[^@]",
|
||||
sscanf(userpass, "%" MAX_CURL_USER_LENGTH_TXT "[^:@]:"
|
||||
"%" MAX_CURL_PASSWORD_LENGTH_TXT "[^@]",
|
||||
user, passwd);
|
||||
}
|
||||
else
|
||||
/* no name given, get the password only */
|
||||
sscanf(userpass, ":%127[^@]", passwd);
|
||||
sscanf(userpass, ":%" MAX_CURL_PASSWORD_LENGTH_TXT "[^@]", passwd);
|
||||
|
||||
if(user[0]) {
|
||||
char *newname=curl_unescape(user, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue