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

13 lines
614 B
Plaintext

$OpenBSD: patch-src_game_c,v 1.1 2004/03/02 22:18:53 naddy Exp $
--- src/game.c.orig 2002-02-22 13:00:24.000000000 +0100
+++ src/game.c 2004-03-02 21:55:07.000000000 +0100
@@ -561,7 +561,7 @@ int game_init()
/* load level */
setname = levelset_names[config.levelset_id];
if ( levelset_names[config.levelset_id][0] == '~' ) {
- sprintf( path, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
+ snprintf( path, sizeof(path), "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
setname++;
}
else