[FFmpeg-devel] [PATCH] Allow use of @ character in username and passwords embedded in URLs

Gavin Kinsey gkinsey at ad-holdings.co.uk
Fri Nov 16 16:58:53 CET 2012


On Friday 16 November 2012 12:56:00 Michael Niedermayer wrote:
> On Thu, Nov 15, 2012 at 11:00:08AM +0000, Gavin Kinsey wrote:
> >  utils.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > 4a332f378c2b3ebfb479499b4cf253f099a273df 
> > 0001-Allow-use-of-character-in-username-and-passwords-emb.patch From
> > bbecafc18e07fdbe109ffe6ded8b7fb7e1f9fade Mon Sep 17 00:00:00 2001
> > From: Gavin Kinsey <gkinsey at ad-holdings.co.uk>
> > Date: Thu, 15 Nov 2012 10:56:47 +0000
> > Subject: [PATCH] Allow use of @ character in username and passwords
> > embedded in URLs
> > 
> > ---
> > 
> >  libavformat/utils.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 4072ac8..8a07f17 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -3620,7 +3620,7 @@ 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) {
> > +        if ((at = strrchr(p, '@')) && at < ls) {
> > 
> >              av_strlcpy(authorization, p,
> 
> wont this break when @ is in the path ? or server name ?

Yes.  But in the actual URL the @ can be encoded using the %nn convention.  
The same isn't true for the ffmpeg parse.  Not ideal but writing a full 
escape handling patch was more than I have time to do at the moment.

-- 
Gavin Kinsey
AD Holdings Plc


--------------------------------------------------------
This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system; you may not copy this message or disclose its contents to anyone. The recipient should check this email and any attachments for the presence of viruses. The Company accepts no liability for any damage caused by any virus transmitted by this email. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the Company. Contact Customer Services for details customerservices at dmicros.com


More information about the ffmpeg-devel mailing list