[vlc-commits] FTP: fail earlier if filename uri_encode fails

Jean-Baptiste Kempf git at videolan.org
Thu Aug 11 17:29:26 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 11 17:27:19 2016 +0200| [d18f0a8c32d2b6df789edb73a87a30337d102e7a] | committer: Jean-Baptiste Kempf

FTP: fail earlier if filename uri_encode fails

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d18f0a8c32d2b6df789edb73a87a30337d102e7a
---

 modules/access/ftp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 3a54987..be68924 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -921,7 +921,8 @@ static int DirRead (access_t *p_access, input_item_node_t *p_current_node)
 
         char *psz_uri;
         char *psz_filename = vlc_uri_encode( psz_file );
-        if( asprintf( &psz_uri, "%s://%s:%d%s%s/%s",
+        if( psz_filename != NULL &&
+            asprintf( &psz_uri, "%s://%s:%d%s%s/%s",
                       ( p_sys->tlsmode == NONE ) ? "ftp" :
                       ( ( p_sys->tlsmode == IMPLICIT ) ? "ftps" : "ftpes" ),
                       p_sys->url.psz_host, p_sys->url.i_port,



More information about the vlc-commits mailing list