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

13 lines
728 B
Plaintext

$OpenBSD: patch-src_manager_c,v 1.1 2004/03/02 22:18:53 naddy Exp $
--- src/manager.c.orig 2002-02-16 15:06:24.000000000 +0100
+++ src/manager.c 2004-03-02 21:55:07.000000000 +0100
@@ -126,7 +126,7 @@ void cb_delete_set()
return;
}
/* get file name + path */
- sprintf( fname, "%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] );
+ snprintf( fname, sizeof(fname), "%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] );
remove( fname );
levelsets_load_names(); /* reinit name lists and configs indices */
/* reassign these name lists as position in memory has changed */