[vlc-devel] [PATCH] sftp: fix url decoding

Petri Hintukainen phintuka at gmail.com
Wed Jan 20 13:40:15 CET 2016


On ke, 2016-01-20 at 14:18 +0200, Rémi Denis-Courmont wrote:
> Nack. This makes no sense.

Then something else is broken.

Without the patch it passes url-encoded file names to libssh. And fails
if there are ex. spaces in the paths.

Le 2016-01-20 14:12, Petri Hintukainen a écrit :
> > ---
> >  modules/access/sftp.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/modules/access/sftp.c b/modules/access/sftp.c
> > index ece9e95..b1809e5 100644
> > --- a/modules/access/sftp.c
> > +++ b/modules/access/sftp.c
> > @@ -130,7 +130,11 @@ static int Open( vlc_object_t* p_this )
> >      vlc_credential_init( &credential, &credential_url );
> > 
> >      /* Parse the URL */
> > -    vlc_UrlParse( &url, p_access->psz_location );
> > +    char *psz_decoded_url = vlc_uri_decode_duplicate(
> > p_access->psz_location );
> > +    if( psz_decoded_url == NULL )
> > +        goto error;
> > +    vlc_UrlParse( &url, psz_decoded_url );
> > +    free( psz_decoded_url );
> > 
> >      /* Check for some parameters */
> >      if( EMPTY_STR( url.psz_host ) )
> 


More information about the vlc-devel mailing list