Commit 19660a88 authored by Gavin Kinsey's avatar Gavin Kinsey Committed by Michael Niedermayer

Allow use of @ character in username and passwords embedded in URLs

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ebf47502
......@@ -3592,7 +3592,7 @@ void av_url_split(char *proto, int proto_size,
char *path, int path_size,
const char *url)
{
const char *p, *ls, *ls2, *at, *col, *brk;
const char *p, *ls, *ls2, *at, *at2, *col, *brk;
if (port_ptr) *port_ptr = -1;
if (proto_size > 0) proto[0] = 0;
......@@ -3627,9 +3627,10 @@ void av_url_split(char *proto, int proto_size,
/* the rest is hostname, use that to parse auth/port */
if (ls != p) {
/* authorization (user[:pass]@hostname) */
if ((at = strchr(p, '@')) && at < ls) {
av_strlcpy(authorization, p,
FFMIN(authorization_size, at + 1 - p));
at2 = p;
while ((at = strchr(p, '@')) && at < ls) {
av_strlcpy(authorization, at2,
FFMIN(authorization_size, at + 1 - at2));
p = at + 1; /* skip '@' */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment