diff options
author | Christian Weisgerber <naddy@FreeBSD.org> | 2004-03-02 22:48:03 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@FreeBSD.org> | 2004-03-02 22:48:03 +0000 |
commit | 90c5e88130a7d154dc434cab89b359e6e58b6a19 (patch) | |
tree | 02deca0c5d548fd3578ab2b81dcbadf41b3b09da /games/lbreakout2/files/patch-src_editor.c | |
parent | - Update to 3.9 (diff) |
Prevent buffer overflow from environment variable.
Obtained from: Ulf Harnhammar and Debian
Notes
Notes:
svn path=/head/; revision=102772
Diffstat (limited to 'games/lbreakout2/files/patch-src_editor.c')
-rw-r--r-- | games/lbreakout2/files/patch-src_editor.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/games/lbreakout2/files/patch-src_editor.c b/games/lbreakout2/files/patch-src_editor.c new file mode 100644 index 000000000000..126c0d7e8bfa --- /dev/null +++ b/games/lbreakout2/files/patch-src_editor.c @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- src/editor.c.orig Tue Mar 2 21:26:03 2004 ++++ src/editor.c Tue Mar 2 21:27:00 2004 +@@ -725,7 +725,7 @@ + { + FILE *file = 0; + /* set full file name */ +- sprintf( edit_file_name, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); ++ snprintf( edit_file_name, sizeof(edit_file_name), "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); + /* test this file for write access. use append to keep contents */ + if ( ( file = fopen( edit_file_name, "a" ) ) == 0 ) { + fprintf( stderr, "Permission to write to file '%s' denied.\n", edit_file_name ); |