From: Laurent Aimar Date: Wed, 8 Apr 2009 19:51:00 +0000 (+0200) Subject: Fixed sanetizing of file name in input_CreateFilename. X-Git-Tag: 1.0.0-pre2~158 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=edc8b8e6116b8b2e119281ab285f71a790703e45;p=vlc Fixed sanetizing of file name in input_CreateFilename. It should fix #2620 (and was not limited to windows only). --- diff --git a/src/input/input.c b/src/input/input.c index 585694448d..dfb27e59ff 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