mirror of https://github.com/mpv-player/mpv
Buffer overflow fix in string handling, patch by c0ntex, approved by .so.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12523 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4d0be09a5d
commit
2bad32fb69
|
@ -43,8 +43,8 @@ inline void TranslateFilename( int c,char * tmp )
|
|||
case STREAMTYPE_FILE:
|
||||
if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
|
||||
{
|
||||
if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
|
||||
else strcpy( tmp,guiIntfStruct.Filename );
|
||||
if ( strrchr( guiIntfStruct.Filename,'/' ) ) strncpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1, 511 );
|
||||
else strncpy( tmp,guiIntfStruct.Filename , 511);
|
||||
if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
|
||||
if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
|
||||
} else strcpy( tmp,MSGTR_NoFileLoaded );
|
||||
|
|
Loading…
Reference in New Issue