openbsd-ports/games/xboing/patches/patch-preview_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
563 B
Plaintext

$OpenBSD: patch-preview_c,v 1.1 2004/03/06 02:41:00 naddy Exp $
--- preview.c.orig 2004-03-06 02:03:41.000000000 +0100
+++ preview.c 2004-03-06 02:04:07.000000000 +0100
@@ -139,7 +139,7 @@ static void DoLoadLevel(display, window)
/* Construct the Preview level filename */
if ((str = getenv("XBOING_LEVELS_DIR")) != NULL)
- sprintf(levelPath, "%s/level%02d.data", str, lnum);
+ snprintf(levelPath, sizeof(levelPath), "%s/level%02d.data", str, lnum);
else
sprintf(levelPath, "%s/level%02d.data", LEVEL_INSTALL_DIR, lnum);