[vlc-devel] commit: Fixed sanetizing of file name in input_CreateFilename. ( Laurent Aimar )

git version control git at videolan.org
Wed Apr 8 22:36:57 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Apr  8 21:51:00 2009 +0200| [edc8b8e6116b8b2e119281ab285f71a790703e45] | committer: Laurent Aimar 

Fixed sanetizing of file name in input_CreateFilename.

It should fix #2620 (and was not limited to windows only).

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

 src/input/input.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 5856944..dfb27e5 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -3253,13 +3253,16 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
         if( !psz_tmp )
             return NULL;
 
-        filename_sanitize( psz_tmp );
-        if( asprintf( &psz_file, "%s"DIR_SEP"%s%s%s",
-                      psz_path, psz_tmp,
+        char *psz_tmp2 = filename_sanitize( psz_tmp );
+        free( psz_tmp );
+
+        if( !psz_tmp2 ||
+            asprintf( &psz_file, "%s"DIR_SEP"%s%s%s",
+                      psz_path, psz_tmp2,
                       psz_extension ? "." : "",
                       psz_extension ? psz_extension : "" ) < 0 )
             psz_file = NULL;
-        free( psz_tmp );
+        free( psz_tmp2 );
         return psz_file;
     }
     else




More information about the vlc-devel mailing list