[vlc-commits] dsm: fix url encoding
Thomas Guillem
git at videolan.org
Mon Jan 11 19:02:15 CET 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 11 17:28:25 2016 +0100| [7c305abc2e263cc9e8f36ade0a3487fdb848ebd4] | committer: Thomas Guillem
dsm: fix url encoding
- pf_readdir will return an encoded item.
- decode the url at opening.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c305abc2e263cc9e8f36ade0a3487fdb848ebd4
---
modules/access/dsm/access.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c
index b91c0df..40dc60e 100644
--- a/modules/access/dsm/access.c
+++ b/modules/access/dsm/access.c
@@ -143,7 +143,11 @@ static int Open( vlc_object_t *p_this )
if( p_sys->p_session == NULL )
goto error;
- vlc_UrlParse( &p_sys->url, p_access->psz_location );
+ char *psz_decoded_location = vlc_uri_decode_duplicate( p_access->psz_location );
+ if( psz_decoded_location == NULL )
+ goto error;
+ vlc_UrlParse( &p_sys->url, psz_decoded_location );
+ free( psz_decoded_location );
if( get_address( p_access ) != VLC_SUCCESS )
goto error;
@@ -529,7 +533,12 @@ static input_item_t *new_item( access_t *p_access, const char *psz_name,
char *psz_uri, *psz_option = NULL;
int i_ret;
- i_ret = asprintf( &psz_uri, "smb://%s/%s", p_access->psz_location, psz_name );
+ char *psz_encoded_name = vlc_uri_encode( psz_name );
+ if( psz_encoded_name == NULL )
+ return NULL;
+ i_ret = asprintf( &psz_uri, "smb://%s/%s", p_access->psz_location,
+ psz_encoded_name );
+ free( psz_encoded_name );
if( i_ret == -1 )
return NULL;
More information about the vlc-commits
mailing list