openbsd-ports/games/lbreakout2/patches/patch-src_levels_c
naddy ec03d9af91 SECURITY: (GID games)
Prevent buffer overflow from environment variable; from Debian.
2004-03-02 22:18:53 +00:00

13 lines
720 B
Plaintext

$OpenBSD: patch-src_levels_c,v 1.1 2004/03/02 22:18:53 naddy Exp $
--- src/levels.c.orig 2002-02-22 13:00:43.000000000 +0100
+++ src/levels.c 2004-03-02 21:55:07.000000000 +0100
@@ -220,7 +220,7 @@ void levelsets_load_names()
/* create dynamic list */
names = list_create( LIST_NO_AUTO_DELETE, NO_CALLBACK );
/* parse home directory */
- sprintf( level_dir, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
+ snprintf( level_dir, sizeof(level_dir), "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
text = get_file_list( level_dir, 0, level_dir );
for ( i = 0; i < text->count; i++ ) {
/* filter stuff */