ec03d9af91
Prevent buffer overflow from environment variable; from Debian.
13 lines
837 B
Plaintext
13 lines
837 B
Plaintext
$OpenBSD: patch-src_main_c,v 1.1 2004/03/02 22:18:53 naddy Exp $
|
|
--- src/main.c.orig 2002-02-22 13:02:01.000000000 +0100
|
|
+++ src/main.c 2004-03-02 21:55:07.000000000 +0100
|
|
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
|
|
/* new set? */
|
|
if ( strequal( "<CREATE SET>", levelset_home_names[config.levelset_home_id] ) ) {
|
|
editor_file = calloc( 16, sizeof( char ) );
|
|
- sprintf( path, "%s/%s/lbreakout2-levels", getenv( "HOME" ), CONFIG_DIR_NAME );
|
|
+ snprintf( path, sizeof(path), "%s/%s/lbreakout2-levels", getenv( "HOME" ), CONFIG_DIR_NAME );
|
|
if ( !enter_string( font, "Set Name:", editor_file, 12 ) || !file_check( path, editor_file, "w" ) ) {
|
|
free( editor_file );
|
|
break;
|