q3map2: better use strncpy instead of strcpy
authorThomas Debesse <dev@illwieckz.net>
Thu, 25 Feb 2021 14:30:55 +0000 (15:30 +0100)
committerThomas Debesse <dev@illwieckz.net>
Fri, 5 Mar 2021 02:17:08 +0000 (03:17 +0100)
tools/quake3/common/vfs.c

index 62881b5e22e167be40135b7c48113c3073d521a6..8f5e57bfb9a1bb0dcfbe4068478eda2520fa6ea9 100644 (file)
@@ -344,7 +344,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
        }
 
        *bufferptr = NULL;
-       strcpy( fixed, filename );
+       strncpy( fixed, filename, sizeof( fixed ) );
        vfsFixDOSName( fixed );
        lower = g_ascii_strdown( fixed, -1 );