aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Kinsey <gkinsey@ad-holdings.co.uk>2012-11-15 10:56:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2012-11-19 18:02:28 +0100
commit19660a887677bdf22593cb89753f13db7f525358 (patch)
tree34cf9ea763d43b69c93f5bde1ebd2183c294478e
parentebf4750200d5c6512605d58ba702775d4f52c53f (diff)
downloadffmpeg-19660a887677bdf22593cb89753f13db7f525358.tar.gz
Allow use of @ character in username and passwords embedded in URLs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index af1f323576..4760f455e1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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 '@' */
}