pkgsrc/games/xboing/patches/patch-ai
snj 8494207f32 strcpy and sprintf are evil, don't use them. Inspired by similar changes
in Debian.  This fixes several locally exploitable vulnerabilities.
2004-02-28 18:36:38 +00:00

13 lines
554 B
Text

$NetBSD: patch-ai,v 1.1 2004/02/28 18:36:38 snj Exp $
--- preview.c.orig 2004-02-28 10:19:15.000000000 -0800
+++ preview.c 2004-02-28 10:19:31.000000000 -0800
@@ -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);