[vlc-devel] [PATCH] sftp: fix url decoding
Thomas Guillem
thomas at gllm.fr
Wed Jan 20 14:20:27 CET 2016
p_access->psz_url and p_access->psz_location are encoded.
Maybe, p_access->psz_location should be decoded before opening an access
module.
On Wed, Jan 20, 2016, at 13:40, Petri Hintukainen wrote:
> 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 ) )
> >
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list