openbsd-ports/games/xboing/patches/patch-demo_c
naddy 11467f34ea * Prevent environment variables from overflowing buffers.
Adapted from Debian via Robert Nagy <thuglife@bsd.hu>.
* Fix high score file handling.
2004-03-06 02:41:00 +00:00

13 lines
515 B
Plaintext

$OpenBSD: patch-demo_c,v 1.1 2004/03/06 02:41:00 naddy Exp $
--- demo.c.orig 2004-03-06 01:50:10.000000000 +0100
+++ demo.c 2004-03-06 01:51:28.000000000 +0100
@@ -154,7 +154,7 @@ static void DoBlocks(display, window)
/* Construct the demo level filename */
if ((str = getenv("XBOING_LEVELS_DIR")) != NULL)
- sprintf(levelPath, "%s/demo.data", str);
+ snprintf(levelPath, sizeof(levelPath), "%s/demo.data", str);
else
sprintf(levelPath, "%s/demo.data", LEVEL_INSTALL_DIR);