diff options
author | agc <agc@pkgsrc.org> | 2004-03-08 17:44:16 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2004-03-08 17:44:16 +0000 |
commit | 44b8132cea96f82444c631d4835ebb548486a921 (patch) | |
tree | 4151d76860522ab6e64779874e524bd1d43fcf13 /games/xboing/patches/patch-ag | |
parent | d1c51cbccd057d56f9237360a9657dfb0e84b4ef (diff) | |
download | pkgsrc-44b8132cea96f82444c631d4835ebb548486a921.tar.gz |
Pull up security fixes to the pkgsrc-2003Q4 branch, requested by Sorenpkgsrc-2003Q4
Jacobsen.
Module Name: pkgsrc
Committed By: snj
Date: Sat Feb 28 18:36:38 UTC 2004
Modified Files:
pkgsrc/games/xboing: Makefile distinfo
pkgsrc/games/xboing/patches: patch-ad
Added Files:
pkgsrc/games/xboing/patches: patch-ae patch-af patch-ag patch-ah
patch-ai
Log Message:
strcpy and sprintf are evil, don't use them. Inspired by similar changes
in Debian. This fixes several locally exploitable vulnerabilities.
Diffstat (limited to 'games/xboing/patches/patch-ag')
-rw-r--r-- | games/xboing/patches/patch-ag | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/games/xboing/patches/patch-ag b/games/xboing/patches/patch-ag new file mode 100644 index 00000000000..af2d9468db0 --- /dev/null +++ b/games/xboing/patches/patch-ag @@ -0,0 +1,49 @@ +$NetBSD: patch-ag,v 1.1.2.2 2004/03/08 17:44:16 agc Exp $ + +--- file.c.orig 2004-02-28 10:10:55.000000000 -0800 ++++ file.c 2004-02-28 10:12:50.000000000 -0800 +@@ -139,7 +139,7 @@ void SetupStage(display, window) + + /* Construct the level filename */ + if ((str = getenv("XBOING_LEVELS_DIR")) != NULL) +- sprintf(levelPath, "%s/level%02ld.data", str, newLevel); ++ snprintf(levelPath, sizeof(levelPath), "%s/level%02ld.data", str, newLevel); + else + sprintf(levelPath, "%s/level%02ld.data", LEVEL_INSTALL_DIR, newLevel); + +@@ -177,7 +177,7 @@ int LoadSavedGame(display, window) + static int bgrnd = 1; + + /* Save the file in home directory - construct path */ +- sprintf(levelPath, "%s/.xboing-saveinfo", GetHomeDir()); ++ snprintf(levelPath, sizeof(levelPath), "%s/.xboing-saveinfo", GetHomeDir()); + + /* Open the save file info for reading */ + if ((saveFile = fopen(levelPath, "r+")) == NULL) +@@ -239,7 +239,7 @@ int LoadSavedGame(display, window) + DisplayLevelInfo(display, levelWindow, level); + + /* Load the saved file in home directory - construct path */ +- sprintf(levelPath, "%s/.xboing-savelevel", GetHomeDir()); ++ snprintf(levelPath, sizeof(levelPath), "%s/.xboing-savelevel", GetHomeDir()); + + /* Read in the saved level data */ + if (ReadNextLevel(display, window, levelPath, True) == False) +@@ -283,7 +283,7 @@ int SaveCurrentGame(display, window) + saveGame.numBullets = GetNumberBullets(); + + /* Save the file in home directory - construct path */ +- sprintf(levelPath, "%s/.xboing-saveinfo", GetHomeDir()); ++ snprintf(levelPath, sizeof(levelPath), "%s/.xboing-saveinfo", GetHomeDir()); + + /* Open the save file info for writing */ + if ((saveFile = fopen(levelPath, "w+")) == NULL) +@@ -309,7 +309,7 @@ int SaveCurrentGame(display, window) + WarningMessage("Cannot close save game info file."); + + /* Save the file in home directory - construct path */ +- sprintf(levelPath, "%s/.xboing-savelevel", GetHomeDir()); ++ snprintf(levelPath, sizeof(levelPath), "%s/.xboing-savelevel", GetHomeDir()); + + if (SaveLevelDataFile(display, levelPath) == True) + { |