Skip to content

Commit bcebedd

Browse files
committed
lsteamclinet: fixed potential stack-based buffer overflow in unixlib
1 parent 3a269ab commit bcebedd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lsteamclient/unixlib.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,8 @@ char *steamclient_dos_to_unix_path( const char *src, int is_url )
941941
{
942942
if (strncmp( src, file_prot, 7 ) != 0)
943943
{
944-
strcpy( dst, src );
944+
strncpy( dst, src, sizeof(buffer) - 1 );
945+
dst[sizeof(buffer) - 1] = '\0';
945946
goto done;
946947
}
947948

0 commit comments

Comments
 (0)