0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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:
diego 2004-06-02 12:40:41 +00:00
parent 4d0be09a5d
commit 2bad32fb69

View File

@ -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 );