mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
Allow use of @ character in username and passwords embedded in URLs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ebf4750200
commit
19660a8876
@ -3592,7 +3592,7 @@ void av_url_split(char *proto, int proto_size,
|
|||||||
char *path, int path_size,
|
char *path, int path_size,
|
||||||
const char *url)
|
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 (port_ptr) *port_ptr = -1;
|
||||||
if (proto_size > 0) proto[0] = 0;
|
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 */
|
/* the rest is hostname, use that to parse auth/port */
|
||||||
if (ls != p) {
|
if (ls != p) {
|
||||||
/* authorization (user[:pass]@hostname) */
|
/* authorization (user[:pass]@hostname) */
|
||||||
if ((at = strchr(p, '@')) && at < ls) {
|
at2 = p;
|
||||||
av_strlcpy(authorization, p,
|
while ((at = strchr(p, '@')) && at < ls) {
|
||||||
FFMIN(authorization_size, at + 1 - p));
|
av_strlcpy(authorization, at2,
|
||||||
|
FFMIN(authorization_size, at + 1 - at2));
|
||||||
p = at + 1; /* skip '@' */
|
p = at + 1; /* skip '@' */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user